/** * @param path IGFS path. * @param isFile Path is a file. * @param isDir Path is a directory. * @param blockSize Block size in bytes. * @param accessTime Access time in millis. * @param modTime Modification time in millis. * @param len File length in bytes. * @param props Properties. */ public LocalFileSystemIgfsFile(IgfsPath path, boolean isFile, boolean isDir, int blockSize, long accessTime, long modTime, long len, Map<String, String> props) { assert !isDir || blockSize == 0 : "blockSize must be 0 for dirs. [blockSize=" + blockSize + ']'; assert !isDir || len == 0 : "length must be 0 for dirs. [length=" + len + ']'; this.path = path; flags = IgfsUtils.flags(isDir, isFile); this.blockSize = blockSize; this.accessTime = accessTime; this.modTime = modTime; this.len = len; this.props = props; }
/** * Constructs directory info. * * @param path Path. * @param info Entry info. * @param globalGrpBlockSize Global group block size. */ public IgfsFileImpl(IgfsPath path, IgfsEntryInfo info, long globalGrpBlockSize) { A.notNull(path, "path"); A.notNull(info, "info"); this.path = path; fileId = info.id(); flags = IgfsUtils.flags(info.isDirectory(), info.isFile()); if (info.isFile()) { blockSize = info.blockSize(); len = info.length(); grpBlockSize = info.affinityKey() == null ? globalGrpBlockSize : info.length() == 0 ? globalGrpBlockSize : info.length(); } props = info.properties(); if (props == null) props = Collections.emptyMap(); accessTime = info.accessTime(); modificationTime = info.modificationTime(); }
/** * A copy constructor. All the fields are copied from the copied {@code igfsFile}, but the {@code groupBlockSize} * which is specified separately. * * @param igfsFile The file to copy. * @param grpBlockSize Group block size. */ public IgfsFileImpl(IgfsFile igfsFile, long grpBlockSize) { A.notNull(igfsFile, "igfsFile"); this.path = igfsFile.path(); this.fileId = igfsFile instanceof IgfsFileImpl ? ((IgfsFileImpl)igfsFile).fileId : IgniteUuid.randomUuid(); this.blockSize = igfsFile.blockSize(); this.len = igfsFile.length(); this.grpBlockSize = igfsFile.isFile() ? grpBlockSize : 0L; this.props = igfsFile.properties(); this.accessTime = igfsFile.accessTime(); this.modificationTime = igfsFile.modificationTime(); this.flags = IgfsUtils.flags(igfsFile.isDirectory(), igfsFile.isFile()); }
/** * @param path IGFS path. * @param isFile Path is a file. * @param isDir Path is a directory. * @param blockSize Block size in bytes. * @param accessTime Access time in millis. * @param modTime Modification time in millis. * @param len File length in bytes. * @param props Properties. */ public LocalFileSystemIgfsFile(IgfsPath path, boolean isFile, boolean isDir, int blockSize, long accessTime, long modTime, long len, Map<String, String> props) { assert !isDir || blockSize == 0 : "blockSize must be 0 for dirs. [blockSize=" + blockSize + ']'; assert !isDir || len == 0 : "length must be 0 for dirs. [length=" + len + ']'; this.path = path; flags = IgfsUtils.flags(isDir, isFile); this.blockSize = blockSize; this.accessTime = accessTime; this.modTime = modTime; this.len = len; this.props = props; }
/** * Constructs directory info. * * @param path Path. * @param info Entry info. * @param globalGrpBlockSize Global group block size. */ public IgfsFileImpl(IgfsPath path, IgfsEntryInfo info, long globalGrpBlockSize) { A.notNull(path, "path"); A.notNull(info, "info"); this.path = path; fileId = info.id(); flags = IgfsUtils.flags(info.isDirectory(), info.isFile()); if (info.isFile()) { blockSize = info.blockSize(); len = info.length(); grpBlockSize = info.affinityKey() == null ? globalGrpBlockSize : info.length() == 0 ? globalGrpBlockSize : info.length(); } props = info.properties(); if (props == null) props = Collections.emptyMap(); accessTime = info.accessTime(); modificationTime = info.modificationTime(); }
/** * A copy constructor. All the fields are copied from the copied {@code igfsFile}, but the {@code groupBlockSize} * which is specified separately. * * @param igfsFile The file to copy. * @param grpBlockSize Group block size. */ public IgfsFileImpl(IgfsFile igfsFile, long grpBlockSize) { A.notNull(igfsFile, "igfsFile"); this.path = igfsFile.path(); this.fileId = igfsFile instanceof IgfsFileImpl ? ((IgfsFileImpl)igfsFile).fileId : IgniteUuid.randomUuid(); this.blockSize = igfsFile.blockSize(); this.len = igfsFile.length(); this.grpBlockSize = igfsFile.isFile() ? grpBlockSize : 0L; this.props = igfsFile.properties(); this.accessTime = igfsFile.accessTime(); this.modificationTime = igfsFile.modificationTime(); this.flags = IgfsUtils.flags(igfsFile.isDirectory(), igfsFile.isFile()); }