org.apache.ignite.internal.processors.igfs

## Class IgfsFileImpl

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

All Implemented Interfaces:
  Externalizable, Serializable, IgfsFile

    public final class IgfsFileImpl
    extends Object
    implements IgfsFile, Externalizable

File or directory information.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgfsFileImpl()` Empty constructor required by `Externalizable`.
`IgfsFileImpl(IgfsFile igfsFile, long grpBlockSize)` A copy constructor.
`IgfsFileImpl(IgfsPath path, IgfsEntryInfo info, long globalGrpBlockSize)` Constructs directory info.

### Method Summary

Methods
`long` `accessTime()` Gets file last access time.
`int` `blockSize()` Gets file's data block size.
`boolean` `equals(Object o)`
`IgniteUuid` `fileId()`
`long` `groupBlockSize()` Gets file group block size (i.e. block size * group size).
`int` `hashCode()`
`boolean` `isDirectory()` Check this file is a directory.
`boolean` `isFile()` Check this file is a data file.
`long` `length()` Gets file's length.
`long` `modificationTime()` Gets file last modification time.
`IgfsPath` `path()` Gets path to file.
`Map<String,String>` `properties()` Get properties of the file.
`String` `property(String name)` Get file's property for specified name.
`String` `property(String name, String dfltVal)` Get file's property for specified name.
`void` `readExternal(ObjectInput in)` Reads object from data input.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)` Writes object to data output.

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

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

### Constructor Detail

#### IgfsFileImpl

    public IgfsFileImpl()

Empty constructor required by `Externalizable`.

#### IgfsFileImpl

    public IgfsFileImpl(IgfsFile igfsFile,
                long grpBlockSize)

A copy constructor. All the fields are copied from the copied `igfsFile`, but the `groupBlockSize` which is specified separately.

Parameters:
  `igfsFile` - The file to copy.

#### IgfsFileImpl

    public IgfsFileImpl(IgfsPath path,
                IgfsEntryInfo info,
                long globalGrpBlockSize)

Constructs directory info.

Parameters:
  `path` - Path.

### Method Detail

#### path

    public IgfsPath path()

Gets path to file.

Specified by:
  `path` in interface `IgfsFile`
Returns:
  Path to file.

#### fileId

    public IgniteUuid fileId()

Returns:
  File ID.

#### isFile

    public boolean isFile()

Check this file is a data file.

Specified by:
  `isFile` in interface `IgfsFile`
Returns:
  `True` if this is a data file.

#### isDirectory

    public boolean isDirectory()

Check this file is a directory.

Specified by:
  `isDirectory` in interface `IgfsFile`
Returns:
  `True` if this is a directory.

#### length

    public long length()

Gets file's length.

Specified by:
  `length` in interface `IgfsFile`
Returns:
  File's length or `zero` for directories.

#### blockSize

    public int blockSize()

Gets file's data block size.

Specified by:
  `blockSize` in interface `IgfsFile`
Returns:
  File's data block size or `zero` for directories.

#### groupBlockSize

    public long groupBlockSize()

Gets file group block size (i.e. block size * group size).

Specified by:
  `groupBlockSize` in interface `IgfsFile`
Returns:
  File group block size.

#### accessTime

    public long accessTime()

Gets file last access time. File last access time is not updated automatically due to performance considerations and can be updated on demand with `IgniteFileSystem.setTimes(IgfsPath, long, long)` method.

By default last access time equals file creation time.

Specified by:
  `accessTime` in interface `IgfsFile`
Returns:
  Last access time.

#### modificationTime

    public long modificationTime()

Gets file last modification time. File modification time is updated automatically on each file write and append.

Specified by:
  `modificationTime` in interface `IgfsFile`
Returns:
  Last modification time.

#### property

    public String property(String name)
                    throws IllegalArgumentException

Get file's property for specified name.

Specified by:
  `property` in interface `IgfsFile`
Parameters:
  `name` - Name of the property.
Returns:
  File's property for specified name.
Throws:
  `IllegalArgumentException` - If requested property was not found.

#### property

    public String property(String name,
                  @Nullable
                  String dfltVal)

Get file's property for specified name.

Specified by:
  `property` in interface `IgfsFile`
Parameters:
  `name` - Name of the property.
  `dfltVal` - Default value if requested property was not found.
Returns:
  File's property for specified name.

#### properties

    public Map<String,String> properties()

Get properties of the file.

Specified by:
  `properties` in interface `IgfsFile`
Returns:
  Properties of the file.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Writes object to data output.

Specified by:
  `writeExternal` in interface `Externalizable`
Parameters:
  `out` - Data output.
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException

Reads object from data input.

Specified by:
  `readExternal` in interface `Externalizable`
Parameters:
  `in` - Data input.
Throws:
  `IOException`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

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.6.0
Release Date | : May 18 2016