/** * Locates a file by URI. * * @param uri The URI of the file to locate. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri) throws FileSystemException { return resolveFile(getBaseFile(), uri); }
/** * Locates a file by URI. * * @param uri The URI of the file to locate. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri) throws FileSystemException { return resolveFile(getBaseFile(), uri); }
/** * Locates a file by URI. * * @param uri The URI of the file to locate. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri) throws FileSystemException { return resolveFile(getBaseFile(), uri); }
/** * Locates a file by URI. * @param uri The URI of the file to locate. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri) throws FileSystemException { return resolveFile(getBaseFile(), uri); }
/** * Locate a file by URI, use the FileSystemOptions for file-system creation. * * @param uri The URI of the file to locate. * @param fileSystemOptions The options for the FileSystem. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // return resolveFile(baseFile, uri, fileSystemOptions); return resolveFile(getBaseFile(), uri, fileSystemOptions); }
/** * Locate a file by URI, use the FileSystemOptions for file-system creation. * * @param uri The URI of the file to locate. * @param fileSystemOptions The options for the FileSystem. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // return resolveFile(baseFile, uri, fileSystemOptions); return resolveFile(getBaseFile(), uri, fileSystemOptions); }
/** * Locate a file by URI, use the FileSystemOptions for file-system creation. * * @param uri The URI of the file to locate. * @param fileSystemOptions The options for the FileSystem. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // return resolveFile(baseFile, uri, fileSystemOptions); return resolveFile(getBaseFile(), uri, fileSystemOptions); }
/** * Locate a file by URI, use the FileSystemOptions for file-system creation. * @param uri The URI of the file to locate. * @param fileSystemOptions The options for the FileSystem. * @return The FileObject for the located file. * @throws FileSystemException if the file cannot be located or an error occurs. */ @Override public FileObject resolveFile(final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // return resolveFile(baseFile, uri, fileSystemOptions); return resolveFile(getBaseFile(), uri, fileSystemOptions); }
/** * Initialize the message manager server "virtual file system" * * @param integFolder Base path where all messages folders are stored * @throws FileSystemException Thrown if an error occurred when initializing the file system manager */ private void setBaseDir(String integFolder) throws FileSystemException { DefaultFileSystemManager manager = (DefaultFileSystemManager) VFS.getManager(); if (manager.getBaseFile() == null) { manager.setBaseFile(new File(integFolder)); if (!manager.getBaseFile().exists()) { manager.getBaseFile().createFolder(); } } else { String path = manager.getBaseFile().getURL().getPath(); logService.warn(() -> "VFS already has a base file: " + path); } }
private FileObject findFileInArchive(String archiveFile, String tgzName, String filename) throws IOException { DefaultFileSystemManager fsManager = (DefaultFileSystemManager) VFS.getManager(); FileObject jarFile; try { String uri = "tgz:" + archiveFile + tgzName + ".tgz" + "!" + File.separator + tgzName + File.separator; if (LOG.isDebugEnabled()) { LOG.debug("base file is " + fsManager.getBaseFile().getURL().getPath()); LOG.debug(uri); } jarFile = fsManager.resolveFile(uri); } catch (FileSystemException e) { if (LOG.isDebugEnabled()) { LOG.debug("", e); } return null; } FileObject[] children = jarFile.getChildren(); for (FileObject child : children) { String baseName = child.getName().getBaseName(); if (filename.equals(baseName)) { return child; } } return null; }