FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { if (store.retrieveMetadata(key + FOLDER_SUFFIX) != null) {
FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { if (store.retrieveMetadata(key + FOLDER_SUFFIX) != null) {
LOG.debug("getFileStatus retrieving metadata for key '" + key + "'"); FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { if(LOG.isDebugEnabled()) { if (store.retrieveMetadata(key + FOLDER_SUFFIX) != null) { if(LOG.isDebugEnabled()) { LOG.debug("getFileStatus returning 'directory' for key '" + key +
FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { return new FileStatus[] { newFile(meta, absolutePath) }; store.retrieveMetadata(key + FOLDER_SUFFIX) == null) { return null;
FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { return new FileStatus[] { newFile(meta, absolutePath) }; store.retrieveMetadata(key + FOLDER_SUFFIX) == null) { throw new FileNotFoundException("File " + f + " does not exist.");
FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { return new FileStatus[] { newFile(meta, absolutePath) }; store.retrieveMetadata(key + FOLDER_SUFFIX) == null) { return null;
@Override public FileStatus getFileStatus(Path f) throws IOException { Path absolutePath = makeAbsolute(f); String key = pathToKey(absolutePath); if (key.length() == 0) { // root always exists return newDirectory(absolutePath); } FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { return newFile(meta, absolutePath); } if (store.retrieveMetadata(key + FOLDER_SUFFIX) != null) { return newDirectory(absolutePath); } PartialListing listing = store.list(key, 1); if (listing.getFiles().length > 0 || listing.getCommonPrefixes().length > 0) { return newDirectory(absolutePath); } throw new FileNotFoundException(absolutePath + ": No such file or directory."); }
@Override public FileStatus getFileStatus(Path f) throws IOException { Path absolutePath = makeAbsolute(f); String key = pathToKey(absolutePath); if (key.length() == 0) { // root always exists return newDirectory(absolutePath); } FileMetadata meta = store.retrieveMetadata(key); if (meta != null) { return newFile(meta, absolutePath); } if (store.retrieveMetadata(key + FOLDER_SUFFIX) != null) { return newDirectory(absolutePath); } PartialListing listing = store.list(key, 1); if (listing.getFiles().length > 0 || listing.getCommonPrefixes().length > 0) { return newDirectory(absolutePath); } throw new FileNotFoundException(absolutePath + ": No such file or directory."); }