/** * Constructs a new file system node name by parsing the given URI * after applying the given URI modifier. * * @param uri the {@link #getUri() URI}. * @param modifier the URI modifier. * @throws NullPointerException if {@code uri} or {@code modifier} are * {@code null}. * @throws URISyntaxException if {@code uri} still does not conform to the * syntax constraints for file system node names after its * modification. */ public FsNodeName(URI uri, final FsUriModifier modifier) throws URISyntaxException { parse(modifier.modify(uri, NODE_NAME)); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { try { parse(new URI(in.readObject().toString())); // protect against manipulation } catch (URISyntaxException ex) { throw (InvalidObjectException) new InvalidObjectException(ex.toString()) .initCause(ex); } }