@Override public void close() throws IOException { /* * Allow original buffer to be garbage collected and prevent it being * remapped for this FileResouce. */ buffer = CLOSED; if (deleteOnClose) IO.delete(file); }
public void remove() { if (dir.getParentFile() != null) { IO.delete(dir); } }
/** * Deletes the specified file. Folders are recursively deleted.<br> * If file(s) cannot be deleted, no feedback is provided (fail silently). * * @param file file to be deleted */ public static void delete(File file) { delete(file.toPath()); }
public void remove() { if (dir.getParentFile() != null) { IO.delete(dir); } }
@Override public void clear() { data = new Data(); IO.delete(where); }
private void doRoot(Project p, File root) throws IOException { if (!root.isFile()) { IO.delete(root); copy("rootpom.xml", "../pom.xml", p); } }
private void doRoot(Project p, File root) throws IOException { if( !root.isFile()) { IO.delete(root); copy("rootpom.xml", "../pom.xml", p); } }
@Override public void close() { IO.close(printer); IO.delete(file); }
@Override public void run() { File dir = repo.storage.toLocalFile(archive) .getParentFile(); IO.delete(dir); }
/** * Delete a cache entry */ @Override public boolean deleteCache(byte[] id) throws Exception { File dir = IO.getFile(cache, Hex.toHexString(id)); if (dir.isDirectory()) { IO.delete(dir); return true; } return false; }
@Override public boolean exists(Archive archive) throws Exception { File file = File.createTempFile("pom", ".xml"); try { File result = getFile(archive.getPomArchive(), file); return result != null; } catch (Exception e) { return false; } finally { IO.delete(file); } }
public boolean removePlugin(String alias) { File ext = getFile(Workspace.CNFDIR + "/" + Workspace.EXT); File f = new File(ext, alias + ".bnd"); if (!f.exists()) { error("No such plugin %s", alias); return false; } IO.delete(f); refresh(); return true; }
public boolean removePlugin(String alias) { File ext = getFile(Workspace.CNFDIR + "/" + Workspace.EXT); File f = new File(ext, alias + ".bnd"); if ( !f.exists()) { error("No such plugin %s", alias); return false; } IO.delete(f); refresh(); return true; }
public boolean removePlugin(String alias) { File ext = getFile(Workspace.CNFDIR + "/" + Workspace.EXT); File f = new File(ext, alias + ".bnd"); if ( !f.exists()) { error("No such plugin %s", alias); return false; } IO.delete(f); refresh(); return true; }
public void write(File file) throws Exception { check(); try (OutputStream out = IO.outputStream(file)) { write(out); } catch (Exception t) { IO.delete(file); throw t; } file.setLastModified(lastModified); }
Releaser(MavenRepository home, Revision revision, MavenBackingRepository repo, Properties context) throws Exception { this.home = home; this.revision = revision; this.repo = repo; this.context = context; this.dir = home.toLocalFile(revision.path); IO.delete(this.dir); check(); IO.mkdirs(this.dir); }
private void save(Release releaser, Revision revision, Jar jar) throws Exception { String classifier = jar.getName(); // jar name is classifier String extension = "jar"; File tmp = File.createTempFile(classifier, extension); try { jar.write(tmp); releaser.add(revision.archive(extension, classifier), tmp); } finally { IO.delete(tmp); } }
public void remove() throws Exception { getWorkspace().removeProject(this); IO.delete(getBase()); } }