@Override
 public StorageMetadata getContainerMetadata(String container) {
   MutableStorageMetadata metadata = new MutableStorageMetadataImpl();
   metadata.setName(container);
   metadata.setType(StorageType.CONTAINER);
   metadata.setLocation(getLocation(container));
   Path path = new File(buildPathStartingFromBaseDir(container)).toPath();
   BasicFileAttributes attr;
   try {
     attr = readAttributes(path, BasicFileAttributes.class);
   } catch (IOException e) {
     throw Throwables.propagate(e);
   }
   metadata.setCreationDate(new Date(attr.creationTime().toMillis()));
   return metadata;
 }
예제 #2
0
 public StorageMetadata apply(String from) {
   MutableStorageMetadata returnVal = new MutableStorageMetadataImpl();
   returnVal.setType(StorageType.RELATIVE_PATH);
   returnVal.setName(from);
   return returnVal;
 }