/** * Create directory and it's parents. * * @param pathIds Path IDs. * @param lockInfos Lock infos. * @param dirProps Directory properties. * @return Result or {@code} if the first parent already contained child with the same name. * @throws IgniteCheckedException If failed. */ @Nullable IgfsPathsCreateResult createDirectory(IgfsPathIds pathIds, Map<IgniteUuid, IgfsEntryInfo> lockInfos, Map<String, String> dirProps) throws IgniteCheckedException { // Check if entry we are going to write to is directory. if (lockInfos.get(pathIds.lastExistingId()).isFile()) throw new IgfsParentNotDirectoryException("Failed to create directory (parent " + "element is not a directory)"); return createFileOrDirectory(true, pathIds, lockInfos, dirProps, null, 0, null, false, null, null); }
/** * Create file and all it's parents. * * @param pathIds Paths IDs. * @param lockInfos Lock infos. * @param dirProps Directory properties. * @param fileProps File propertris. * @param blockSize Block size. * @param affKey Affinity key (optional) * @param evictExclude Evict exclude flag. * @param secondaryCtx Secondary file system create context. * @param secondaryOutHolder Holder for the secondary output stream. * @return Result or {@code} if the first parent already contained child with the same name. * @throws IgniteCheckedException If failed. */ @Nullable private IgfsPathsCreateResult createFile(IgfsPathIds pathIds, Map<IgniteUuid, IgfsEntryInfo> lockInfos, Map<String, String> dirProps, Map<String, String> fileProps, int blockSize, @Nullable IgniteUuid affKey, boolean evictExclude, @Nullable IgfsSecondaryFileSystemCreateContext secondaryCtx, @Nullable T1<OutputStream> secondaryOutHolder) throws IgniteCheckedException{ // Check if entry we are going to write to is directory. if (lockInfos.get(pathIds.lastExistingId()).isFile()) throw new IgfsParentNotDirectoryException("Failed to open file for write " + "(parent element is not a directory): " + pathIds.path()); return createFileOrDirectory(false, pathIds, lockInfos, dirProps, fileProps, blockSize, affKey, evictExclude, secondaryCtx, secondaryOutHolder); }
/** * Create directory and it's parents. * * @param pathIds Path IDs. * @param lockInfos Lock infos. * @param dirProps Directory properties. * @return Result or {@code} if the first parent already contained child with the same name. * @throws IgniteCheckedException If failed. */ @Nullable IgfsPathsCreateResult createDirectory(IgfsPathIds pathIds, Map<IgniteUuid, IgfsEntryInfo> lockInfos, Map<String, String> dirProps) throws IgniteCheckedException { // Check if entry we are going to write to is directory. if (lockInfos.get(pathIds.lastExistingId()).isFile()) throw new IgfsParentNotDirectoryException("Failed to create directory (parent " + "element is not a directory)"); return createFileOrDirectory(true, pathIds, lockInfos, dirProps, null, 0, null, false, null, null); }
/** * Create file and all it's parents. * * @param pathIds Paths IDs. * @param lockInfos Lock infos. * @param dirProps Directory properties. * @param fileProps File propertris. * @param blockSize Block size. * @param affKey Affinity key (optional) * @param evictExclude Evict exclude flag. * @param secondaryCtx Secondary file system create context. * @param secondaryOutHolder Holder for the secondary output stream. * @return Result or {@code} if the first parent already contained child with the same name. * @throws IgniteCheckedException If failed. */ @Nullable private IgfsPathsCreateResult createFile(IgfsPathIds pathIds, Map<IgniteUuid, IgfsEntryInfo> lockInfos, Map<String, String> dirProps, Map<String, String> fileProps, int blockSize, @Nullable IgniteUuid affKey, boolean evictExclude, @Nullable IgfsSecondaryFileSystemCreateContext secondaryCtx, @Nullable T1<OutputStream> secondaryOutHolder) throws IgniteCheckedException{ // Check if entry we are going to write to is directory. if (lockInfos.get(pathIds.lastExistingId()).isFile()) throw new IgfsParentNotDirectoryException("Failed to open file for write " + "(parent element is not a directory): " + pathIds.path()); return createFileOrDirectory(false, pathIds, lockInfos, dirProps, fileProps, blockSize, affKey, evictExclude, secondaryCtx, secondaryOutHolder); }