code: public static FileInfo parseFileName(File file)
      {
          // Owned filenames have the form:
          //    dbname/CURRENT
          //    dbname/LOCK
          //    dbname/LOG
          //    dbname/LOG.old
          //    dbname/MANIFEST-[0-9]+
          //    dbname/[0-9]+.(log|sst|dbtmp)
          String fileName = file.getName();
          if ("CURRENT".equals(fileName)) {
              return new FileInfo(FileType.CURRENT);
          }
          else if ("LOCK".equals(fileName)) {
              return new FileInfo(FileType.DB_LOCK);
          }
          else if ("LOG".equals(fileName)) {
              return new FileInfo(FileType.INFO_LOG);
          }
          else if ("LOG.old".equals(fileName)) {
              return new FileInfo(FileType.INFO_LOG);
          }
          else if (fileName.startsWith("MANIFEST-")) {
              long fileNumber = Long.parseLong(removePrefix(fileName, "MANIFEST-"));
              return new FileInfo(FileType.DESCRIPTOR, fileNumber);
          }
          else if (fileName.endsWith(".log")) {
              long fileNumber = Long.parseLong(removeSuffix(fileName, ".log"));
              return new FileInfo(FileType.LOG, fileNumber);
          }
          else if (fileName.endsWith(".sst")) {
              long fileNumber = Long.parseLong(removeSuffix(fileName, ".sst"));
              return new FileInfo(FileType.TABLE, fileNumber);
          }
          else if (fileName.endsWith(".dbtmp")) {
              long fileNumber = Long.parseLong(removeSuffix(fileName, ".dbtmp"));
              return new FileInfo(FileType.TEMP, fileNumber);
          }
          return null;
      }
docs: If filename is a leveldb file, store the type of the file in *type.
  The number encoded in the filename is stored in *number.  If the
  filename was successfully parsed, returns true.  Else return false.