protected String getPrefix() { return getScheme() + ":"; }
@Override public FilePath unwrap() { return unwrap(name); }
@Override public boolean createFile() { log(Recorder.CREATE_NEW_FILE, name); return super.createFile(); }
@Override public OutputStream newOutputStream(boolean append) throws IOException { log(Recorder.OPEN_OUTPUT_STREAM, name); return super.newOutputStream(append); }
@Override public void delete() { log(Recorder.DELETE, name); super.delete(); }
@Override public FileChannel open(String mode) throws IOException { return new FileRec(this, super.open(mode), name); }
@Override public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException { log(Recorder.CREATE_TEMP_FILE, unwrap(name) + ":" + suffix + ":" + deleteOnExit + ":" + inTempDir); return super.createTempFile(suffix, deleteOnExit, inTempDir); }
@Override public void moveTo(FilePath newPath, boolean atomicReplace) { log(Recorder.RENAME, unwrap(name) + ":" + unwrap(newPath.name)); super.moveTo(newPath, atomicReplace); }
/** * Get the base path for the given wrapped path. * * @param path the path including the scheme prefix * @return the base file path */ protected FilePath unwrap(String path) { return FilePath.get(path.substring(getScheme().length() + 1)); }