소스 검색

add FileUtil.appendToFileNameBeforeExt

master
Jonathan Cobb 4 년 전
부모
커밋
64ef7809a0
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. +5
    -0
      src/main/java/org/cobbzilla/util/io/FileUtil.java

+ 5
- 0
src/main/java/org/cobbzilla/util/io/FileUtil.java 파일 보기

@@ -485,6 +485,11 @@ public class FileUtil {
return f.getName().substring(0, f.getName().length() - ext.length());
}

public static String appendToFileNameBeforeExt(String path, String part) {
final int dotPos = path.lastIndexOf('.');
return dotPos == -1 ? path + part : path.substring(0, dotPos) + part + path.substring(dotPos);
}

/**
* @param dir The directory to search
* @return The most recently modified file, or null if the dir does not exist, is not a directory, or does not contain any files


불러오는 중...
취소
저장