@Override public boolean endsWith(final String other) throws InvalidPathException { checkNotNull("other", other); return endsWith(getFileSystem().getPath(other)); }
@Override public boolean startsWith(final String other) throws InvalidPathException { checkNotNull("other", other); return startsWith(getFileSystem().getPath(other)); }
@Override public boolean startsWith(final String other) throws InvalidPathException { checkNotNull("other", other); return startsWith(getFileSystem().getPath(other)); }
@Override public boolean endsWith(final String other) throws InvalidPathException { checkNotNull("other", other); return endsWith(getFileSystem().getPath(other)); }
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
public ConfigView(final AbstractPath path) { super(path); final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
public ConfigView(final AbstractPath path) { super(path); final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
private void readAttributesTest(final boolean generated) { AttrsStorage attrsStorage = mock(AttrsStorage.class); when(attrsStorage.getContent()).thenReturn(new HashMap<String, Object>() {{ put(GeneratedAttributesView.GENERATED_ATTRIBUTE_NAME, generated); }}); AbstractPath path = mock(AbstractPath.class); when(path.getAttrStorage()).thenReturn(attrsStorage); FileSystemProvider fileSystemProvider = mock(FileSystemProvider.class); BasicFileAttributeView basicFileAttributeView = mock(BasicFileAttributeView.class); when(basicFileAttributeView.readAttributes()).thenReturn(mock(BasicFileAttributes.class)); when(fileSystemProvider.getFileAttributeView(any(), any())).thenReturn(basicFileAttributeView); FileSystem fileSystem = mock(FileSystem.class); when(fileSystem.provider()).thenReturn(fileSystemProvider); when(path.getFileSystem()).thenReturn(fileSystem); GeneratedAttributesView view = new GeneratedAttributesView(path); GeneratedFileAttributes generatedFileAttributes = view.readAttributes(); assertEquals(generated, generatedFileAttributes.isGenerated()); } }
private void readAttributesTest(final boolean generated) { AttrsStorage attrsStorage = mock(AttrsStorage.class); when(attrsStorage.getContent()).thenReturn(new HashMap<String, Object>() {{ put(GeneratedAttributesView.GENERATED_ATTRIBUTE_NAME, generated); }}); AbstractPath path = mock(AbstractPath.class); when(path.getAttrStorage()).thenReturn(attrsStorage); FileSystemProvider fileSystemProvider = mock(FileSystemProvider.class); BasicFileAttributeView basicFileAttributeView = mock(BasicFileAttributeView.class); when(basicFileAttributeView.readAttributes()).thenReturn(mock(BasicFileAttributes.class)); when(fileSystemProvider.getFileAttributeView(any(), any())).thenReturn(basicFileAttributeView); FileSystem fileSystem = mock(FileSystem.class); when(fileSystem.provider()).thenReturn(fileSystemProvider); when(path.getFileSystem()).thenReturn(fileSystem); GeneratedAttributesView view = new GeneratedAttributesView(path); GeneratedFileAttributes generatedFileAttributes = view.readAttributes(); assertEquals(generated, generatedFileAttributes.isGenerated()); } }
private void readAttributesTest(final boolean generated) { AttrsStorage attrsStorage = mock(AttrsStorage.class); when(attrsStorage.getContent()).thenReturn(new HashMap<String, Object>() {{ put(GeneratedAttributesView.GENERATED_ATTRIBUTE_NAME, generated); }}); AbstractPath path = mock(AbstractPath.class); when(path.getAttrStorage()).thenReturn(attrsStorage); FileSystemProvider fileSystemProvider = mock(FileSystemProvider.class); BasicFileAttributeView basicFileAttributeView = mock(BasicFileAttributeView.class); when(basicFileAttributeView.readAttributes()).thenReturn(mock(BasicFileAttributes.class)); when(fileSystemProvider.getFileAttributeView(any(), any())).thenReturn(basicFileAttributeView); FileSystem fileSystem = mock(FileSystem.class); when(fileSystem.provider()).thenReturn(fileSystemProvider); when(path.getFileSystem()).thenReturn(fileSystem); GeneratedAttributesView view = new GeneratedAttributesView(path); GeneratedFileAttributes generatedFileAttributes = view.readAttributes(); assertEquals(generated, generatedFileAttributes.isGenerated()); } }
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
final Map<String, Object> content = path.getAttrStorage().getContent(); final BasicFileAttributes fileAttrs = path.getFileSystem().provider().getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();