/** * internal implementation of directory creation * * @param path path to file * @return boolean file is created * @throws IOException if specified path is file instead of directory */ private boolean mkdir(Path path) throws IOException { Path absolutePath = makeAbsolute(path); if (!store.objectExists(absolutePath)) { store.createDirectory(absolutePath); } // TODO: define a consistent semantic for a directory/subdirectory // in the hadoop:swift bridge. Hadoop FS assumes that there // are files and directories, whereas SwiftFS assumes // that there are just "objects" /* FileStatus fileStatus; try { fileStatus = getFileStatus(absolutePath); if (!fileStatus.isDir()) { throw new SwiftException(String.format( "Can't make directory for path '%s' since it exists and is not a directory: %s", path, fileStatus)); } } catch (FileNotFoundException e) { if (LOG.isDebugEnabled()) { LOG.debug("Making dir '" + path + "' in Swift"); } //file is not found: it must be created store.createDirectory(absolutePath); } */ return true; }