org.apache.ignite.internal.processors.igfs

## Class IgfsFileInfo

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.IgfsFileInfo

All Implemented Interfaces:
  Externalizable, Serializable

    public final class IgfsFileInfo
    extends Object
    implements Externalizable

Unmodifiable file information.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `IgfsFileInfo.Builder` Builder for `IgfsFileInfo`.

### Field Summary

Fields
`static IgniteUuid` `ROOT_ID` ID for the root directory.
`static IgniteUuid` `TRASH_ID` ID of the trash directory.

### Constructor Summary

Constructors
Constructor and Description
`IgfsFileInfo()` `Externalizable` support.
`IgfsFileInfo(boolean isDir, Map<String,String> props)` Constructs directory or file info with `default` block size.
`IgfsFileInfo(IgfsFileInfo info)` A copy constructor, which takes all data from the specified object field-by-field.
`IgfsFileInfo(int blockSize, long len, IgniteUuid affKey, IgniteUuid lockId, boolean evictExclude, Map<String,String> props)` Constructs file info.

### Method Summary

Methods
`long` `accessTime()`
`IgniteUuid` `affinityKey()`
`void` `affinityKey(IgniteUuid affKey)`
`long` `blocksCount()`
`int` `blockSize()` Get single data block size to store this file.
`static IgfsFileInfo.Builder` `builder()` Creates a builder for the new instance of file info.
`static IgfsFileInfo.Builder` `builder(IgfsFileInfo origin)` Creates a builder for the new instance of file info, based on the specified origin.
`boolean` `equals(Object obj)`
`boolean` `evictExclude()` Get evict exclude flag.
`IgfsFileMap` `fileMap()`
`void` `fileMap(IgfsFileMap fileMap)`
`int` `hashCode()`
`IgniteUuid` `id()` Gets this item ID.
`boolean` `isDirectory()`
`boolean` `isFile()`
`long` `length()` Get file size.
`Map<String,IgfsListingEntry>` `listing()`
`IgniteUuid` `lockId()` Get lock ID.
`long` `modificationTime()`
`IgfsPath` `path()`
`Map<String,String>` `properties()` Get properties of the file.
`void` `readExternal(ObjectInput in)`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ROOT_ID

    public static final IgniteUuid ROOT_ID

ID for the root directory.

#### TRASH_ID

    public static final IgniteUuid TRASH_ID

ID of the trash directory.

### Constructor Detail

#### IgfsFileInfo

    public IgfsFileInfo()

`Externalizable` support.

#### IgfsFileInfo

    public IgfsFileInfo(boolean isDir,
                @Nullable
                Map<String,String> props)

Constructs directory or file info with `default` block size.

Parameters:
  `isDir` - Constructs directory info if `true` or file info if `false`.
  `props` - Meta properties to set.

#### IgfsFileInfo

    public IgfsFileInfo(int blockSize,
                long len,
                @Nullable
                IgniteUuid affKey,
                @Nullable
                IgniteUuid lockId,
                boolean evictExclude,
                @Nullable
                Map<String,String> props)

Constructs file info.

Parameters:
  `blockSize` - Block size.
  `len` - Length.
  `affKey` - Affinity key.
  `lockId` - Lock ID.
  `props` - Properties.
  `evictExclude` - Evict exclude flag.

#### IgfsFileInfo

    public IgfsFileInfo(IgfsFileInfo info)

A copy constructor, which takes all data from the specified object field-by-field.

Parameters:
  `info` - An object to copy data info.

### Method Detail

#### builder

    public static IgfsFileInfo.Builder builder()

Creates a builder for the new instance of file info.

Returns:
  A builder to construct a new unmodifiable instance of this class.

#### builder

    public static IgfsFileInfo.Builder builder(IgfsFileInfo origin)

Creates a builder for the new instance of file info, based on the specified origin.

Parameters:
  `origin` - An origin for new instance, from which the data will be copied.
Returns:
  A builder to construct a new unmodifiable instance of this class.

#### id

    public IgniteUuid id()

Gets this item ID.

Returns:
  This item ID.

#### isFile

    public boolean isFile()

Returns:
  `True` if this is a file.

#### isDirectory

    public boolean isDirectory()

Returns:
  `True` if this is a directory.

#### length

    public long length()

Get file size.

Returns:
  File size.

#### blockSize

    public int blockSize()

Get single data block size to store this file.

Returns:
  Single data block size to store this file.

#### blocksCount

    public long blocksCount()

Returns:
  Number of data blocks to store this file.

#### accessTime

    public long accessTime()

Returns:
  Last access time.

#### modificationTime

    public long modificationTime()

Returns:
  Last modification time.

#### listing

    public Map<String,IgfsListingEntry> listing()

Returns:
  Directory listing.

#### affinityKey

    @Nullable
    public IgniteUuid affinityKey()

Returns:
  Affinity key used for single-node file collocation. If `null`, usual mapper procedure is used for block affinity detection.

#### affinityKey

    public void affinityKey(IgniteUuid affKey)

Parameters:
  `affKey` - Affinity key used for single-node file collocation.

#### fileMap

    public IgfsFileMap fileMap()

Returns:
  File affinity map.

#### fileMap

    public void fileMap(IgfsFileMap fileMap)

Parameters:
  `fileMap` - File affinity map.

#### properties

    public Map<String,String> properties()

Get properties of the file.

Returns:
  Properties of the file.

#### lockId

    @Nullable
    public IgniteUuid lockId()

Get lock ID.

Returns:
  Lock ID if file is locked or `null` if file is free of locks.

#### evictExclude

    public boolean evictExclude()

Get evict exclude flag.

Returns:
  Evict exclude flag.

#### path

    public IgfsPath path()

Returns:
  Original file path. This is a helper field used only in some operations like delete.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015