51Degrees Pipeline for Java

fiftyone.common.wrappers.io.FileWrapper Interface Reference

Detailed Description

Interface for a data file.

By default this is a simple wrapper for basic file operations. But this allows the file system to be removed from unit tests by implementing the interface.

Inheritance diagram for fiftyone.common.wrappers.io.FileWrapper:

[legend]

Public Member Functions

BinaryWriter getWriter () throws IOException
 Get a BinaryWriter for this file, positioned at the first byte.
BinaryReader getReader () throws IOException
 Get a BinaryReader for this file, positioned at the first byte.
long getLastModified ()
 Get the time the file was last modified.
String getPath ()
 Get the path to the data file.
boolean exists ()
void delete ()

Member Function Documentation

◆ getLastModified()

long fiftyone.common.wrappers.io.FileWrapper.getLastModified ( )

Get the time the file was last modified.

Returns
last modified date

Implemented in fiftyone.common.wrappers.io.FileWrapperDefault, and fiftyone.common.wrappers.io.FileWrapperMemory.

◆ getPath()

String fiftyone.common.wrappers.io.FileWrapper.getPath ( )

Get the path to the data file.

Returns
file path

Implemented in fiftyone.common.wrappers.io.FileWrapperDefault, and fiftyone.common.wrappers.io.FileWrapperMemory.

◆ getReader()

BinaryReader fiftyone.common.wrappers.io.FileWrapper.getReader ( ) throws IOException

Get a BinaryReader for this file, positioned at the first byte.

The file must exist.

Returns
new BinaryReader
Exceptions
IOExceptionif the file is not found

Implemented in fiftyone.common.wrappers.io.FileWrapperDefault, and fiftyone.common.wrappers.io.FileWrapperMemory.

◆ getWriter()

BinaryWriter fiftyone.common.wrappers.io.FileWrapper.getWriter ( ) throws IOException

Get a BinaryWriter for this file, positioned at the first byte.

The file must already exist.

Returns
new BinaryWriter
Exceptions
IOExceptionif the file is not found

Implemented in fiftyone.common.wrappers.io.FileWrapperDefault, and fiftyone.common.wrappers.io.FileWrapperMemory.