public static File mkparent(final File file) { mkdirs(file.getParentFile()); return file; }
public static File mkparent(final File file) { mkdirs(file.getParentFile()); return file; }
public ZipService() { SystemInstance.get().setComponent(ZipService.class, this); File tempFolderMutable = new File(System.getProperty("openejb.base", ""), "work"); if (!tempFolderMutable.isDirectory()) { tempFolderMutable = new File(System.getProperty("java.io.tmpdir"), ZipService.class.getName() + "_" + System.nanoTime()); Files.mkdirs(tempFolderMutable); Files.deleteOnExit(tempFolderMutable); } // use a subfolder of work one tmpFolder = Files.mkdirs(new File(tempFolderMutable, ZipService.class.getName())); }
private String doResolve(final String rawLocation, final File file, final ArchiveResolver resolver) { final InputStream resolverStream = resolver.resolve(rawLocation); if (LocalInputStream.class.isInstance(resolverStream)) { return LocalInputStream.class.cast(resolverStream).path; } if (resolverStream != null) { BufferedInputStream is = null; try { is = new BufferedInputStream(resolverStream); Files.mkdirs(file.getParentFile()); IO.copy(is, file); return file.getAbsolutePath(); } catch (final IOException ioe) { throw new IllegalArgumentException(ioe); } finally { IO.close(is); } } else { throw new IllegalArgumentException("Could not resolve (" + rawLocation + ')'); } }
private static Collection<String> extract(final String zip) throws IOException { final File tmp = new File(SystemInstance.get().getBase().getDirectory(), ProvisioningResolver.TEMP_DIR); if (!tmp.exists()) { try { Files.mkdirs(tmp); } catch (final Files.FileRuntimeException fre) { // ignored } } final File zipFile = new File(zip); final File extracted = new File(tmp, zipFile.getName().replace(".zip", "")); if (extracted.exists()) { return list(extracted); } else { Files.mkdirs(extracted); } Zips.unzip(zipFile, extracted); return list(extracted); }
private static Collection<String> extract(final String zip) throws IOException { final File tmp = new File(SystemInstance.get().getBase().getDirectory(), TEMP_DIR); if (!tmp.exists()) { try { Files.mkdirs(tmp); } catch (final Files.FileRuntimeException fre) { // ignored } } final File zipFile = new File(realLocation(zip)); final File extracted = new File(tmp, zipFile.getName().replace(".zip", "")); if (extracted.exists()) { return list(extracted); } else { Files.mkdirs(extracted); } Zips.unzip(zipFile, extracted); return list(extracted); }
Files.mkdirs(destination);
Files.mkdirs(destinationDir); } catch (final Files.FileRuntimeException e) { throw new IOException("Failed to create: " + destinationDir);
Files.mkdirs(destinationDir); } catch (final Files.FileRuntimeException e) { throw new IOException("Failed to create: " + destinationDir);
Files.mkdirs(destination);
try { if (!deployed.exists()) { Files.mkdirs(deployed); // can throw runtime exceptions
Files.mkdirs(zipFile.getParentFile()); try { final ZipFile zip = new ZipFile(zipFile);