/** * Retrieve the last element of this path. * * @return <code>None</code> iff this path is empty. */ public OptionType<String> getBaseName() { if (this.names.isEmpty() == false) { final String x = this.names.get(this.names.size() - 1); assert x != null; return Option.some(x); } return Option.none(); }
private static XMLInserts loadXMLInserts( final CommandLine line) throws ValidityException, ParsingException, IOException { final OptionType<Element> start; if (line.hasOption(JSCMain.OPT_XHTML_BODY_START)) { final File file = new File(line.getOptionValue(JSCMain.OPT_XHTML_BODY_START)); final Builder b = new Builder(); final Document d = b.build(file); start = com.io7m.jfunctional.Option.some(d.getRootElement()); } else { start = com.io7m.jfunctional.Option.none(); } final OptionType<Element> end; if (line.hasOption(JSCMain.OPT_XHTML_BODY_END)) { final File file = new File(line.getOptionValue(JSCMain.OPT_XHTML_BODY_END)); final Builder b = new Builder(); final Document d = b.build(file); end = com.io7m.jfunctional.Option.some(d.getRootElement()); } else { end = com.io7m.jfunctional.Option.none(); } return new XMLInserts(start, end); }
ArchiveZipReference( final Archive<ArchiveZipKind> in_archive, final PathVirtual in_path, final Type in_type, final @Nullable ZipEntry actual) throws FilesystemError { super(in_archive, in_path, in_type); if (actual == null) { if (in_path.isRoot() == false) { throw new FilesystemError( Code.FS_ERROR_CONSTRAINT_ERROR, "Path must be root for null zip entry"); } this.zip_entry_opt = Option.none(); } else { this.zip_entry_opt = Option.some(actual); } }
return Option.none();