@Override public boolean createFile() { return base.createFile(); }
/** * Create a new file. This method is similar to Java 7 * <code>java.nio.file.Path.createFile</code>, but returns false instead of * throwing a exception if the file already existed. * * @param fileName the file name * @return true if creating was successful */ public static boolean createFile(String fileName) { return FilePath.get(fileName).createFile(); }
/** * Create a new temporary file. * * @param suffix the suffix * @param deleteOnExit if the file should be deleted when the virtual * machine exists * @param inTempDir if the file should be stored in the temporary directory * @return the name of the created file */ @SuppressWarnings("unused") public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException { while (true) { FilePath p = getPath(name + getNextTempFileNamePart(false) + suffix); if (p.exists() || !p.createFile()) { // in theory, the random number could collide getNextTempFileNamePart(true); continue; } p.open("rw").close(); return p; } }
@Override public boolean createFile() { return base.createFile(); }
@Override public boolean createFile() { return base.createFile(); }
/** * Create a new file. This method is similar to Java 7 * <code>java.nio.file.Path.createFile</code>, but returns false instead of * throwing a exception if the file already existed. * * @param fileName the file name * @return true if creating was successful */ public static boolean createFile(String fileName) { return FilePath.get(fileName).createFile(); }
/** * Create a new file. This method is similar to Java 7 * <code>java.nio.file.Path.createFile</code>, but returns false instead of * throwing a exception if the file already existed. * * @param fileName the file name * @return true if creating was successful */ public static boolean createFile(String fileName) { return FilePath.get(fileName).createFile(); }
/** * Create a new temporary file. * * @param suffix the suffix * @param deleteOnExit if the file should be deleted when the virtual * machine exists * @param inTempDir if the file should be stored in the temporary directory * @return the name of the created file */ public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException { while (true) { FilePath p = getPath(name + getNextTempFileNamePart(false) + suffix); if (p.exists() || !p.createFile()) { // in theory, the random number could collide getNextTempFileNamePart(true); continue; } p.open("rw").close(); return p; } }
/** * Create a new temporary file. * * @param suffix the suffix * @param deleteOnExit if the file should be deleted when the virtual * machine exists * @param inTempDir if the file should be stored in the temporary directory * @return the name of the created file */ public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException { while (true) { FilePath p = getPath(name + getNextTempFileNamePart(false) + suffix); if (p.exists() || !p.createFile()) { // in theory, the random number could collide getNextTempFileNamePart(true); continue; } p.open("rw").close(); return p; } }