/** * Deletes the files, or should it fail to, schedule it for deletion using {@link java.io.File#deleteOnExit()} * * @throws IOException If an error occurs while deleting the file. */ public void close() throws IOException { if (!delete()) { deleteOnExit(); } } }
public TempFile(String prefix, String suffix, File directory) throws IOException { super(genPath(prefix, suffix, directory)); }
@Override public APIProvisioningDescriptor getAPIProvisioningDescriptor() throws IOException, HttpException { if (apiProvisioningDescriptor == null) { try (TempFile tempFile = new TempFile("anyp-apparch")) { try (FileOutputStream fos = new FileOutputStream(tempFile)) { client.getHttpHelper().httpGetBasicAuth("https://maven.anypoint.mulesoft.com/api/v1/organizations/" + orgId + "/maven/" + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "-mule-application.jar", fos); } apiProvisioningDescriptor = readDescriptorFromZip(tempFile); return apiProvisioningDescriptor; } } return null; }
if (source instanceof FileApplicationSource || source.getLocalFile() != null) { File oldFile = source.getLocalFile(); File newFile = new TempFile("tranformed", filename); source = new FileApplicationSource(client, newFile); Unpacker unpacker = new Unpacker(oldFile, FileType.ZIP, newFile, FileType.ZIP);
/** * Deletes the files, or should it fail to, schedule it for deletion using {@link java.io.File#deleteOnExit()} * * @throws IOException If an error occurs while deleting the file. */ public void close() throws IOException { if (!delete()) { deleteOnExit(); } } }
private static String genPath(String prefix, String suffix) throws IOException { return genPath(prefix, suffix, null); }
public TempFile(String prefix) throws IOException { super(genPath(prefix, "tmp")); }
private static String genPath(String prefix, String suffix) throws IOException { return genPath(prefix, suffix, null); }
public TempFile(String prefix, String suffix, File directory) throws IOException { super(genPath(prefix, suffix, directory)); }
public TempFile(String prefix) throws IOException { super(genPath(prefix, "tmp")); }
public TempFile(String prefix, String suffix) throws IOException { super(genPath(prefix, suffix)); }
public TempFile(String prefix, String suffix) throws IOException { super(genPath(prefix, suffix)); }