@Override public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) { return NetUtil.lengthenURI(getUserArea(), hiddenFolderName); } };
/** * The URL for the cached index file for this installer */ protected URI getCachedIndexFile() throws InstallException { return NetUtil.lengthenURI(getCachedIndexDir(), FILE_LIST_GZ); }
@Override public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) { return NetUtil.lengthenURI(getUserArea(), visibleFolderName); } },
@Override public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) { return NetUtil.lengthenURI(getUserArea(), visibleFolderName); } },
@Override public URI getUserArea() { return NetUtil.lengthenURI(getUserHome(), MAC_USER_DATA_AREA); }
@Override public URI getUserArea() { return NetUtil.lengthenURI(getUserHome(), WIN32_USER_DATA_AREA); }
public boolean accept(String name) { return NetUtil.isDirectory(NetUtil.lengthenURI(parent, name)); }
/** * Create a the URI for a (potentially non-existent) file to which we can * write. Typically this is used to store user preferences and application * overrides. This method of acquiring files is preferred over * getResourceProperties() as this is writable and can take into account * user preferences. This method makes no promise that the URI returned is * valid. It is totally untested, so reading may well cause errors. * * @param subject * The name (minus the .xxx extension) * @param extension * The extension, prefixed with a '.' See: {@link FileUtil} for a * list of popular extensions. * @return The resource as a URI */ public URI getWritableURI(String subject, String extension) { return NetUtil.lengthenURI(getWritableProjectDir(), subject + extension); }
/** * Look for the resource in the home directories, returning the first * readable file. * * @param search * must be non-null, non-empty * @return the URI of the home of the resource */ public static URI findHomeResource(String search) { if (homes == null) { return null; } for (int i = 0; i < homes.length; i++) { URI homeURI = homes[i]; URI override = NetUtil.lengthenURI(homeURI, search); // Make sure the file exists and can be read if (NetUtil.canRead(override)) { return override; } } return null; }
private String getExpandedDataPath() throws BookException { URI loc = NetUtil.lengthenURI(bmd.getLibrary(), bmd.getProperty(SwordBookMetaData.KEY_DATA_PATH)); if (loc == null) { // FIXME(DMS): missing parameter throw new BookException(JSOtherMsg.lookupText("Missing data files for old and new testaments in {0}.")); } return new File(loc.getPath()).getAbsolutePath(); }
URI search = NetUtil.lengthenURI(uri, INDEX_FILE); reply = listByIndexFile(search, filter); } catch (FileNotFoundException ex) {
/** * A directory within the project directory. * * @param subject * A name for the subdirectory of the Project directory. * @param create whether to create the directory if it does not exist * @return A file: URI pointing at a local writable directory. * @throws IOException */ public URI getWritableProjectSubdir(String subject, boolean create) throws IOException { URI temp = NetUtil.lengthenURI(getWritableProjectDir(), subject); if (create && !NetUtil.isDirectory(temp)) { NetUtil.makeDirectory(temp); } return temp; }
super(bookMetaData); URI path = SwordUtil.getExpandedDataPath(bookMetaData); String otAllButLast = NetUtil.lengthenURI(path, File.separator + SwordConstants.FILE_OT + '.' + blockType.getIndicator() + SUFFIX_PART1).getPath(); File otIdxFile = new File(otAllButLast + SUFFIX_INDEX); File otTextFile = new File(otAllButLast + SUFFIX_TEXT); File otCompFile = new File(otAllButLast + SUFFIX_COMP); String ntAllButLast = NetUtil.lengthenURI(path, File.separator + SwordConstants.FILE_NT + '.' + blockType.getIndicator() + SUFFIX_PART1).getPath(); File ntIdxFile = new File(ntAllButLast + SUFFIX_INDEX); File ntTextFile = new File(ntAllButLast + SUFFIX_TEXT);
URI path = SwordUtil.getExpandedDataPath(bookMetaData); URI otPath = NetUtil.lengthenURI(path, File.separator + SwordConstants.FILE_OT); otTextFile = new File(otPath.getPath()); otIdxFile = new File(otPath.getPath() + SwordConstants.EXTENSION_VSS); URI ntPath = NetUtil.lengthenURI(path, File.separator + SwordConstants.FILE_NT); ntTextFile = new File(ntPath.getPath()); ntIdxFile = new File(ntPath.getPath() + SwordConstants.EXTENSION_VSS);
URI location = NetUtil.lengthenURI(library, datapath); File bookDir = new File(location.getPath()); location = NetUtil.lengthenURI(library, datapath);
/** * Determine where an index should be stored * * @param book * The book to be indexed * @return A URI to store stuff in * @throws IOException * If there is a problem in finding where to store stuff */ protected URI getStorageArea(Book book) throws IOException { BookMetaData bmd = book.getBookMetaData(); String driverName = bmd.getDriverName(); String bookName = bmd.getInitials(); assert driverName != null; assert bookName != null; //URI driver = NetUtil.lengthenURI(baseFolderURI, driverName); return NetUtil.lengthenURI(baseFolderURI, driverName + NetUtil.SEPARATOR + bookName); }
/** * Returns where the book should be located * @param bookMetaData meta information about the book * @return the URI locating the resource * @throws BookException thrown if an issue is encountered, e.g. missing data files. */ public static URI getExpandedDataPath(BookMetaData bookMetaData) throws BookException { URI loc = NetUtil.lengthenURI(bookMetaData.getLibrary(), bookMetaData.getProperty(SwordBookMetaData.KEY_DATA_PATH)); if (loc == null) { // FIXME(DMS): missing parameter throw new BookException(JSOtherMsg.lookupText("Missing data files for old and new testaments in {0}.")); } return loc; }
try { URI cacheDir = getCachedIndexDir(); URI confDir = NetUtil.lengthenURI(cacheDir, "mods.d.zip"); URI cache = getCachedIndexFile(); download(job, catalogDirectory, FILE_LIST_GZ, cache);
this.frontendReadHome = NetUtil.lengthenURI(this.readHome, this.frontendName);
URI confDir = NetUtil.lengthenURI(cacheDir, "mods.d.zip"); URI cache = getCachedIndexFile();