@Override public FilePath getParent() { String p = new File(name).getParent(); return p == null ? null : getPath(p); }
@Override public FilePathDisk toRealPath() { try { String fileName = new File(name).getCanonicalPath(); return getPath(fileName); } catch (IOException e) { throw DbException.convertIOException(e, name); } }
@Override public List<FilePath> newDirectoryStream() { ArrayList<FilePath> list = new ArrayList<>(); File f = new File(name); try { String[] files = f.list(); if (files != null) { String base = f.getCanonicalPath(); if (!base.endsWith(SysProperties.FILE_SEPARATOR)) { base += SysProperties.FILE_SEPARATOR; } for (int i = 0, len = files.length; i < len; i++) { list.add(getPath(base + files[i])); } } return list; } catch (IOException e) { throw DbException.convertIOException(e, name); } }
@Override public FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException { if (!inTempDir) { throw new IOException("File system is read-only"); } return new FilePathDisk().getPath(name).createTempFile(suffix, deleteOnExit, true); }