private static FileObject resolveFile(final FileSystem fs, final int i) throws FileSystemException { return fs.resolveFile(String.format("%010d", i)); }
private static FileObject resolveFile(final FileSystem fs, final int i) throws FileSystemException { return fs.resolveFile(String.format("%010d", i)); }
private static FileObject resolveFile(final FileSystem fs, final int i) throws FileSystemException { return fs.resolveFile(String.format("%010d", i)); }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will * remove itself from the list of listeners. * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * Tests that sorting ignores case. * * @throws FileSystemException */ @Test public void testSortArrayIgnoreCase() throws FileSystemException { final FileObject file1 = VfsFileSystem.resolveFile("A1"); final FileObject file2 = VfsFileSystem.resolveFile("a2"); final FileObject file3 = VfsFileSystem.resolveFile("A3"); final FileObject[] actualArray = { file3, file1, file2, file1, file2 }; final FileObject[] expectedArray = { file1, file1, file2, file2, file3 }; Arrays.sort(actualArray); Assert.assertArrayEquals(expectedArray, actualArray); }
/** * Tests that sorting ignores case. * * @throws FileSystemException */ @Test public void testSortArrayIgnoreCase() throws FileSystemException { final FileObject file1 = VfsFileSystem.resolveFile("A1"); final FileObject file2 = VfsFileSystem.resolveFile("a2"); final FileObject file3 = VfsFileSystem.resolveFile("A3"); final FileObject[] actualArray = { file3, file1, file2, file1, file2 }; final FileObject[] expectedArray = { file1, file1, file2, file2, file3 }; Arrays.sort(actualArray); Assert.assertArrayEquals(expectedArray, actualArray); }
/** * Tests that sorting ignores case. * * @throws FileSystemException */ @Test public void testSortArrayIgnoreCase() throws FileSystemException { final FileObject file1 = VfsFileSystem.resolveFile("A1"); final FileObject file2 = VfsFileSystem.resolveFile("a2"); final FileObject file3 = VfsFileSystem.resolveFile("A3"); final FileObject[] actualArray = { file3, file1, file2, file1, file2 }; final FileObject[] expectedArray = { file1, file1, file2, file2, file3 }; Arrays.sort(actualArray); Assert.assertArrayEquals(expectedArray, actualArray); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Returns the base folder for tests. */ @Override public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { final FileObject baseFolder = config.getBaseTestFolder(manager); // Create an empty file system, then link in the base folder final FileSystem newFs = manager.createVirtualFileSystem("vfs:").getFileSystem(); final String junctionPoint = "/some/dir"; newFs.addJunction(junctionPoint, baseFolder); return newFs.resolveFile(junctionPoint); }
/** * Returns the base folder for tests. */ @Override public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { final FileObject baseFolder = config.getBaseTestFolder(manager); // Create an empty file system, then link in the base folder final FileSystem newFs = manager.createVirtualFileSystem("vfs:").getFileSystem(); final String junctionPoint = "/some/dir"; newFs.addJunction(junctionPoint, baseFolder); return newFs.resolveFile(junctionPoint); }
/** * Returns the base folder for tests. */ @Override public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { final FileObject baseFolder = config.getBaseTestFolder(manager); // Create an empty file system, then link in the base folder final FileSystem newFs = manager.createVirtualFileSystem("vfs:").getFileSystem(); final String junctionPoint = "/some/dir"; newFs.addJunction(junctionPoint, baseFolder); return newFs.resolveFile(junctionPoint); }
private FileObject getLinkDestination() throws FileSystemException { if (linkDestination == null) { final String path; synchronized (getFileSystem()) { path = this.fileInfo == null ? null : this.fileInfo.getLink(); } final FileName parent = getName().getParent(); final FileName relativeTo = parent == null ? getName() : parent; final FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path); linkDestination = getFileSystem().resolveFile(linkDestinationName); } return linkDestination; }
private FileObject getLinkDestination() throws FileSystemException { if (linkDestination == null) { final String path; synchronized (getFileSystem()) { path = this.fileInfo.getLink(); } FileName relativeTo = getName().getParent(); if (relativeTo == null) { relativeTo = getName(); } final FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path); linkDestination = getFileSystem().resolveFile(linkDestinationName); } return linkDestination; }
private FileObject getLinkDestination() throws FileSystemException { if (linkDestination == null) { final String path; synchronized (getFileSystem()) { path = this.fileInfo.getLink(); } FileName relativeTo = getName().getParent(); if (relativeTo == null) { relativeTo = getName(); } final FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path); linkDestination = getFileSystem().resolveFile(linkDestinationName); } return linkDestination; }