获取 分布式配置文件 获取该配置文件 中 某个配置项 的值

@param fileName
@param fileItem

@return
506467
public static Object getByFileItem(String fileName, String fileItem) {
        return iDisconfDataGetter.getByFileItem(fileName, fileItem);
    }
382449
private String getFilename(String filename, File file) {
        if (!file.exists()) {
            file.mkdirs();
        }
        String ext = ".jpg";
        //get extension
        /*if (Pattern.matches("^[.][p][n][g]", filename)){
            ext = ".png";
        }*/

        return (file.getAbsolutePath() + "/IMG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ext);

    }
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);
    }
925123
public static List<String> readFileFromClassPathAsList(String _fileName) {
    	List<String> result = readFileFromClassPathAsList(_fileName, Charset.defaultCharset(), false);
        return result == null ? new ArrayList<String>() : result;
    }
1121934
public static String cleanFilename(String fileName){
        int lastIndex = fileName.lastIndexOf(".");
        return fileName.substring(0, lastIndex);
    }
628764
public static String getFileExt(String fileName) {
        int dotPos = fileName.lastIndexOf('.');
        if (dotPos != -1 && dotPos != fileName.length() - 1) {
            return fileName.substring(dotPos);
        } else {
            return null;
        }
    }
1077928
public CharSequence readSource(JavaFileObject filename) {
        try {
            inputFiles.add(filename);
            return filename.getCharContent(false);
        } catch (IOException e) {
            log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
            return null;
        }
    }
934554
public ImmutableList<String> getFileAsStringList(String param) throws IOException {
    return FileUtils.loadStringList(Files.asCharSource(getExistingFile(param), Charsets.UTF_8));
  }
984885
private String[] readFile(String fileName) throws IOException {
    ArrayList<String> result = new ArrayList<String>();
    FileReader fReader = new FileReader(fileName);
    BufferedReader bReader = new BufferedReader(fReader);
    while (true) {
      String line = bReader.readLine();
      if (line == null) {
        break;
      }
      result.add(line);
    }
    bReader.close();
    fReader.close();
    return (String[])result.toArray(new String[result.size()]);
  }
134637
public static String fileAsString(String filename) {
    File classpathFile = getClasspathFile(filename);
    return fileAsString(classpathFile);
  }
309990
@Override
    public FileItem file(String name) {
        for (FileItem item : request.getFiles()) {
            // FileItem that do not have an real file attached, should not be returned
            if (item.field().equals(name) && !Strings.isNullOrEmpty(item.name())) {
                return item;
            }
        }
        return null;
    }
315136
public static String getFileNameWithoutExtenxion(String fileName) {
		if (fileName==null){
			return null;
		} else {
			int number=fileName.lastIndexOf('.');
			
			if (number>=0){
				return fileName.substring(0, number);
			} else {
				return fileName;
			}
		}		
	}
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;
  }
23812
public static String getExtension(String fileName) {
        if (fileName == null)
            return null;

        String[] tokens = split(fileName);
        if (tokens.length >= 2)
            return tokens[tokens.length - 1];

        return null;
    }
330045
public static String[] split(String fileName){
        int dot = fileName.lastIndexOf('.');
        if(dot==-1)
            return new String[]{ fileName, null };
        else
            return new String[] { fileName.substring(0, dot), fileName.substring(dot+1)};
    }
716143
public static String getDefaultMimeByExtension(String filename) {
        String type = null;

        if (filename != null) {
            int i = -1;
            while (type == null) {
                i = filename.indexOf(".", i + 1);

                if (i < 0 || i >= filename.length())
                    break;

                String ext = StringUtils.asciiToLowerCase(filename.substring(i + 1));
                type = __dftMimeMap.get(ext);
            }
        }

        if (type == null) {
            type = __dftMimeMap.get("*");
        }

        return type;
    }
222251
def split_by_fname_file(self, fname:PathOrStr, path:PathOrStr=None)->'ItemLists':
        ""
        path = Path(ifnone(path, self.path))
        valid_names = loadtxt_str(path/fname)
        return self.split_by_files(valid_names)