protected ZipBuilder(File zipFile) throws IOException { if (!FileUtil.isExistingFile(zipFile)) { FileUtil.touch(zipFile); } zos = new ZipOutputStream(new FileOutputStream(zipFile)); targetZipFile = zipFile; targetBaos = null; }
protected ZipBuilder(final File zipFile) throws IOException { if (!FileUtil.isExistingFile(zipFile)) { FileUtil.touch(zipFile); } zos = new ZipOutputStream(new FileOutputStream(zipFile)); targetZipFile = zipFile; targetBaos = null; }
@Test void file_exists() throws Exception { final File input = new File(FileUtilTest.class.getResource("data/file/a.txt").toURI()); final boolean actual = FileUtil.isExistingFile(input); // asserts assertEquals(true, actual); }
@Test void file_is_null() throws Exception { final boolean actual = FileUtil.isExistingFile(null); // asserts assertEquals(false, actual); } }
@Test void file_not_exists() throws Exception { final File input = FileUtil.createTempFile("hello", ".jodd", new File(SystemUtil.info().getTempDir()), false); final boolean actual = FileUtil.isExistingFile(input); // asserts assertEquals(false, actual); }
protected ZipBuilder(final File zipFile) throws IOException { if (!FileUtil.isExistingFile(zipFile)) { FileUtil.touch(zipFile); } zos = new ZipOutputStream(new FileOutputStream(zipFile)); targetZipFile = zipFile; targetBaos = null; }
@Override public String loadConfigContent() { if (file == null) { return null; } log.debug("Trying config file: {}", file); if (!FileUtil.isExistingFile(file)) { return null; } try { return FileUtil.readString(file); } catch (IOException ioex) { return null; } }
public LaunchpadBaseStructure(String root) { this.launchpadJson = new File(root, LAUNCHPAD_JSON); if (!FileUtil.isExistingFile(launchpadJson)) { throw new LaunchpadStructureException( "Invalid file: " + launchpadJson); } load(); }