File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
fj-core/src/main/java/org/fugerit/java/core/io Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2828@ Slf4j
2929public class FileIO {
3030
31+ /**
32+ * Creates a new File from a base dir and file name.
33+ *
34+ * If the baseDir is null, only file name is used.
35+ *
36+ * @param baseDir the parent folder
37+ * @param fileName the file name
38+ * @return the File
39+ */
3140 public static File newFile ( String baseDir , String fileName ) {
3241 return baseDir == null ? new File ( fileName ) :new File ( baseDir , fileName );
3342 }
3443
44+ /**
45+ * Creates a new File from a base dir and file name.
46+ *
47+ * If the baseDir is null, only file name is used.
48+ *
49+ * Optionally mustAlreadyExists flag can be set.
50+ *
51+ * @param baseDir the parent folder
52+ * @param fileName the file name
53+ * @param mustAlreadyExists true if final file existence should be checked (if the path does not exist a IOException is thrown)
54+ * @return the File
55+ * @throws IOException in case of issues
56+ */
3557 public static File newFile ( String baseDir , String fileName , boolean mustAlreadyExists ) throws IOException {
3658 File file = newFile ( baseDir , fileName );
3759 if ( mustAlreadyExists && !file .exists () ) {
You can’t perform that action at this time.
0 commit comments