splitter.split(path); final String parent = splitter.getParentPath(); final String member = splitter.getMemberName();
/** * Initialize this file object by scanning its path for archive * files, using the given {@code ancestor} file (i.e. a direct or * indirect parent file) if any. * {@code file} and {@code detector} must already be initialized! * Must not be called to re-initialize this object! */ private void scan(final @CheckForNull TFile ancestor) { final String path = super.getPath(); assert ancestor == null || path.startsWith(ancestor.getPath()); assert file.getPath().equals(path); assert null != detector; final StringBuilder enclEntryNameBuf = new StringBuilder(path.length()); scan(ancestor, detector, 0, path, enclEntryNameBuf, new Splitter(separatorChar, false)); try { enclEntryName = 0 >= enclEntryNameBuf.length() ? null : new FsEntryName( new UriBuilder().path(enclEntryNameBuf.toString()).getUri(), CANONICALIZE); } catch (URISyntaxException ex) { throw new AssertionError(ex); } }
private FsPath scan(final String path) throws URISyntaxException { splitter.split(path); final String ps = splitter.getParentPath(); final FsEntryName men; final FsPath pp; if (null != ps) { men = new FsEntryName( uri.path(splitter.getMemberName()).getUri(), NULL); pp = scan(ps);
private void assertSplit(final String path) { final File file = new File(path); final String parent = file.getParent(); final String member = file.getName(); final Splitter splitter = Paths.split(path, File.separatorChar, false); assertEquals(parent, splitter.getParentPath()); assertEquals(member, splitter.getMemberName()); }