@Override public Map getAttributes() throws FileSystemException { return fileContent.getAttributes(); }
/** * Get a String property from FileContent message * * @param message the File message * @param property property name * @return property value */ public static String getProperty(FileContent message, String property) { try { Object o = message.getAttributes().get(property); if (o instanceof String) { return (String) o; } } catch (FileSystemException ignored) {} return null; }
/** * Returns the attributes of this file. */ @Override protected Map<String, Object> doGetAttributes() throws Exception { return file.getContent().getAttributes(); }
/** * Returns the attributes of this file. */ @Override protected Map<String, Object> doGetAttributes() throws Exception { return file.getContent().getAttributes(); }
/** * Returns the attributes of this file. */ @Override protected Map<String, Object> doGetAttributes() throws Exception { return file.getContent().getAttributes(); }
@Test public void testGetAttributes() throws Exception { decorated.getAttributes(); verify( fileContent ).getAttributes(); }
/** * Tests attributes */ public void testAttributes() throws FileSystemException { this.getReadFolder().getContent().getAttributes(); }
/** * Tests attributes */ public void testAttributes() throws FileSystemException { this.getReadFolder().getContent().getAttributes(); }
@Test public void testAttributes() throws Exception { final FileObject file = JarProviderTestCase.getTestJar(VFS.getManager(), "test.jar"); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertEquals("1.0", attributes.get("Manifest-Version")); // Debugging: // this.printAttributes(attributes); }
@Test public void testAttributes() throws Exception { final FileObject file = JarProviderTestCase.getTestJar(VFS.getManager(), "test.jar"); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertEquals("1.0", attributes.get("Manifest-Version")); // Debugging: // this.printAttributes(attributes); }
@Test public void testNestedAttributes() throws Exception { final FileObject nested = JarProviderTestCase.getTestJar(VFS.getManager(), "nested.jar"); final FileObject file = nested.resolveFile("test.jar"); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertEquals("1.0", attributes.get("Manifest-Version")); // Debugging: // this.printAttributes(attributes); } }
@Test public void testNestedAttributes() throws Exception { final FileObject nested = JarProviderTestCase.getTestJar(VFS.getManager(), "nested.jar"); final FileObject file = nested.resolveFile("test.jar"); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertEquals("1.0", attributes.get("Manifest-Version")); // Debugging: // this.printAttributes(attributes); } }
@Test public void testGetAttributes() throws Exception { final FileObject fo = manager.resolveFile(TEST_DIR1); Assert.assertNotNull(fo); Assert.assertFalse(fo.exists()); // Create the test file final FileObject file = createTestFile(hdfs); Assert.assertTrue(fo.exists()); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.BLOCK_SIZE.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.GROUP.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LAST_ACCESS_TIME.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LENGTH.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.MODIFICATION_TIME.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.OWNER.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.PERMISSIONS.toString())); }
@Test public void testGetAttributes() throws Exception { final FileObject fo = manager.resolveFile(TEST_DIR1); Assert.assertNotNull(fo); Assert.assertFalse(fo.exists()); // Create the test file final FileObject file = createTestFile(hdfs); Assert.assertTrue(fo.exists()); final Map<String, Object> attributes = file.getContent().getAttributes(); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.BLOCK_SIZE.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.GROUP.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LAST_ACCESS_TIME.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LENGTH.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.MODIFICATION_TIME.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.OWNER.toString())); Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.PERMISSIONS.toString())); }
assertTrue(file.isReadable()); assertTrue(file.isWriteable()); Map<?, ?> map = file.getContent().getAttributes(); final String name = ((URLFileName) file.getName()).getUserName(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); map = file.getContent().getAttributes(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); assertEquals(map.get(DeltaVConstants.CREATOR_DISPLAYNAME.toString()), "testUser");
assertTrue(file.isReadable()); assertTrue(file.isWriteable()); Map<?, ?> map = file.getContent().getAttributes(); final String name = ((URLFileName) file.getName()).getUserName(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); map = file.getContent().getAttributes(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); assertEquals(map.get(DeltaVConstants.CREATOR_DISPLAYNAME.toString()), "testUser");
assertTrue(file.isReadable()); assertTrue(file.isWriteable()); Map<?, ?> map = file.getContent().getAttributes(); final String name = ((URLFileName) file.getName()).getUserName(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); map = file.getContent().getAttributes(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); if (name != null) {
assertTrue(file.isReadable()); assertTrue(file.isWriteable()); Map<?, ?> map = file.getContent().getAttributes(); final String name = ((URLFileName) file.getName()).getUserName(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); map = file.getContent().getAttributes(); assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString())); if (name != null) {