/** * Creates a new file. * * <p>Calls through to {@link #createFile(String)}. * * @param location The components of the location. * @return The file handle of the created file. * @throws IOException In the event of an I/O error. */ public File createFile(String... location) throws IOException { Resource resource = get(Paths.path(location)); return Resources.createNewFile(resource); }
/** * Creates a new file. * * <p>Calls through to {@link #createFile(File, String)} * * @param location Location of file to create, either absolute or relative. * @return The file handle of the created file. * @throws IOException In the event of an I/O error. */ public File createFile(String location) throws IOException { Resource resource = get(Paths.convert(location)); return Resources.createNewFile(resource); }
/** * Creates a new file. * * <p>Calls through to {@link #createFile(File, String)} * * @param location Location of file to create, either absolute or relative. * @param parentFile The containing directory for the file. * @return The file handle of the created file. * @throws IOException In the event of an I/O error. */ public File createFile(File parentFile, String... location) throws IOException { Resource resource = get(Paths.convert(getBaseDirectory(), parentFile, location)); return Resources.createNewFile(resource); }
/** * Creates a new file. * * <p>Relative paths are created relative to {@link #baseDirectory}. * * <p>If {@link #baseDirectory} is not set, an IOException is thrown. * * <p>If <code>location</code> already exists as a directory, an IOException is thrown. * * @param location Location of file to create, either absolute or relative. * @param parentFile The containing directory for the file. * @return The file handle of the created file. * @throws IOException In the event of an I/O error. */ public File createFile(File parentFile, String location) throws IOException { Resource resource = get(Paths.convert(getBaseDirectory(), parentFile, location)); return Resources.createNewFile(resource); }
Resources.createNewFile( Files.asResource(new File(srcTemplatesDir.dir(), "title.ftl"))); File srcHeaderFtl = Resources.createNewFile( Files.asResource( new File( "header.ftl"))); File srcFakeFtl = Resources.createNewFile( Files.asResource( new File(