org.apache.ignite.internal.processors.igfs.secondary.local

## Class LocalFileSystemIgfsFile

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemIgfsFile

All Implemented Interfaces:
  IgfsFile

    public class LocalFileSystemIgfsFile
    extends Object
    implements IgfsFile

Implementation of the IgfsFile interface for the local filesystem.

### Constructor Summary

Constructors
Constructor and Description
`LocalFileSystemIgfsFile(IgfsPath path, boolean isFile, boolean isDir, int blockSize, long accessTime, long modTime, long len, Map<String,String> props)`

### Method Summary

Methods
`long` `accessTime()` Gets file last access time.
`int` `blockSize()` Gets file's data block size.
`long` `groupBlockSize()` Gets file group block size (i.e. block size * group size).
`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.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LocalFileSystemIgfsFile

    public LocalFileSystemIgfsFile(IgfsPath path,
                           boolean isFile,
                           boolean isDir,
                           int blockSize,
                           long accessTime,
                           long modTime,
                           long len,
                           Map<String,String> props)

Parameters:
  `path` - IGFS path.
  `isFile` - Path is a file.
  `isDir` - Path is a directory.
  `blockSize` - Block size in bytes.
  `accessTime` - Access time in millis.
  `modTime` - Modification time in millis.
  `len` - File length in bytes.
  `props` - Properties.

### Method Detail

#### path

    public IgfsPath path()

Gets path to file.

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

#### 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.

#### 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

    @Nullable
    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.

#### length

    public long length()

Gets file's length.

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

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017