List of usage examples for javax.tools FileObject delete
boolean delete();
From source file:org.jannocessor.processor.JannocessorProcessorBase.java
private String getPath(Location location) { String path;// ww w . j a va 2 s .com try { FileObject tempFile = filer.getResource(location, "", "jannocessor_temporary"); path = tempFile.toUri().getPath().replaceFirst("/jannocessor_temporary$", "").substring(1); } catch (Exception e) { try { FileObject tempFile = filer.createResource(location, "", "jannocessor_temporary"); path = tempFile.toUri().getPath().replaceFirst("/jannocessor_temporary$", "").substring(1); tempFile.delete(); } catch (Exception e2) { throw new RuntimeException("Cannot calculate path: " + location, e2); } } return path; }