This method return index of the file name (example selion-grid-1.log)

@param fileName
log file name
@return an index value of the file
348304
private int retrieveIndexValueFromFileName(String fileName) {
        int index = 0;
        if (fileName != null && !fileName.trim().isEmpty()) {
            index = Integer.parseInt(fileName.substring(fileName.lastIndexOf('-') + 1,
                    fileName.length() - EXTENSION.length()));
        }
        return index;
    }
751482
public String fileName(int index) {
        byte_vector v = fs.file_name(index).to_bytes();
        return Vectors.byte_vector2utf8(v);
    }
591627
private int parseFileIndex(String fileName) {
    Matcher match = null;
    String indexString = null;
    try {
      match = exportPattern.matcher(fileName);
      match.find();
      indexString = match.group(1);
    } catch (Exception e) {
      throw new IllegalStateException(String.format("Failed to parse file '%s'", fileName), e);
    }
    long longValue = Long.parseLong(indexString);
    if (longValue > Integer.MAX_VALUE) {
      throw new IndexOutOfBoundsException(String.format(
          "Invalid fileName '%s'; max allowable index is %d, got %d instead",
          fileName, Integer.MAX_VALUE, longValue));
    }
    return (int) longValue;
  }
718142
public static String getContentType(String filename) {
		final ContentFileTypeMap map = ensureContentTypeManager();
		return map.getContentType(filename);
	}
1159485
public static String getExtension(String fileName){
        int dot = fileName.lastIndexOf('.');
        return dot==-1 ? null : fileName.substring(dot+1);
    }
164247
public static String getPrefixOfFileName(String fileName) {
        int dotIndex = fileName.lastIndexOf(DOT);
        return dotIndex > 0 ? fileName.substring(0, dotIndex) : fileName;
    }
724320
public String[] getFilenames(String name) 
    {
        List parts = (List)_partMap.getValues(name);
        if (parts==null)
            return null;
        String[] filenames = new String[parts.size()];
        for (int i=0; i<filenames.length; i++) {
            filenames[i] = ((Part)parts.get(i))._filename;
        }
        return filenames;
    }
852839
public static String getSafeExtension(final String filename) {
        // extension does not include period (.)
        final String extension = FilenameUtils.getExtension(filename);
        return isSafeExtension(extension) ? "." + extension : StringUtils.EMPTY;
    }
609548
public IndexEntry findEntryByFileName(String fileName) {
    for (IndexEntry e: entries) {
      if (fileName.equals(e.fileName)) {
        return e;
      }
    }
    return null;
  }
897488
public static String getFileName(File file) {
        if (file == null) return null;
        String name = file.getName();
        return name.startsWith("redkale-") ? name.substring(name.indexOf('_') + 1) : name;
    }
645389
private static final String getExtension(String fileName) {
		return fileName.indexOf('.') == -1 ? null : fileName.substring(fileName.lastIndexOf('.') + 1);
	}
49196
public static String getBaseName(String fileName) {
        if (fileName == null)
            return null;

        String[] tokens = split(fileName);
        return tokens[0];
    }
1114753
public String readFromFile(String fileName) {
    String content = null;
    BufferedReader br = null;
    try {
      File inFile = new File(fileName);
      br = new BufferedReader(new InputStreamReader(
          new FileInputStream(inFile)));
      content = "";
      while(br.ready()) {
      	content += br.readLine();
      }
      br.close();
    } catch (FileNotFoundException ex) {
    	log.error("Failed to find file.", ex);
    } catch (IOException ex) {
    	log.error("Failed to read file.", ex);
    } finally {
    	if(br != null) {
    		try {
    			br.close();
    		} catch(Exception e){}
    	}
    }
    return content;
  }
291922
private String extractExtension(String filename) {
    int startExtension = filename.indexOf('.');
    if (startExtension > 0) {
      return filename.substring(startExtension + 1);
    }
    return "";
  }
1252403
public static String parseLabel(String fileName) {
        if (fileName == null || fileName.isEmpty()) {
            return null;
        }
        int labelIndex = fileName.indexOf(LABELSEPARATOR);
        return labelIndex < 0 ? null : fileName.substring(labelIndex + 1);
    }
317649
public static String getFullPath(String filename) {
        if (filename == null) {
            return null;
        }
        int index = indexOfLastSeparator(filename);
        if (index < 0) {
            return StringUtils.EMPTY;
        }
        return filename.substring(0, index);
    }
196566
public static String getFilenameExtension(String name) {
    if(name == null) {
      return null;
    }
    int index = name.lastIndexOf('.');
    return index < 0 ? null : name.substring(index + 1).toLowerCase();
  }