public class

FileInfoManager

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.utils.FileInfoManager
Known Direct Subclasses

Class Overview

Singleton class to manage files defined as FileInfo

Summary

Public Methods
void addFile(Context context, FileInfo fileInfo)
Adds the specified file into the repository.
void clearFiles(Context context)
Removes all files from the repository.
boolean containsFile(Context context, FileInfo fileInfo)
Checks whether the specified file exists in the repository.
FileInfo getFile(Context context, FileInfo fileInfo)
Returns the file in the repository that equals to the specified file.
FileInfo getFile(Context context, int index)
Returns the n'th file added into the repository.
List<FileInfo> getFiles(Context context)
Returns all files in the repository
boolean isEmpty(Context context)
Checks whether there is any file in the repository.
boolean removeFile(Context context, FileInfo fileToRemove)
Removes the specified file from the repository.
List<FileInfo> removeFiles(Context context, List<FileInfo> filesToRemove)
Removes the specified files from the repository.
void saveFiles(Context context, List<FileInfo> files)
Saves the specified files into the repository.
int size(Context context)
Returns the number of files in the repository.
boolean updateFile(Context context, FileInfo oldFile, FileInfo newFile)
Updates the file in the repository.
void updateFile(Context context, FileInfo fileInfo)
Updates the information of the specified file in the repository.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void addFile (Context context, FileInfo fileInfo)

Adds the specified file into the repository.

Parameters
context The context
fileInfo The file info

public void clearFiles (Context context)

Removes all files from the repository.

Parameters
context The context

public boolean containsFile (Context context, FileInfo fileInfo)

Checks whether the specified file exists in the repository.

Parameters
context The context
fileInfo The FileInfo
Returns
  • True if the file exists in the repository

public FileInfo getFile (Context context, FileInfo fileInfo)

Returns the file in the repository that equals to the specified file. See equals(Object).

Parameters
context The context
fileInfo The file info
Returns

public FileInfo getFile (Context context, int index)

Returns the n'th file added into the repository.

Parameters
context The context
index The index of the file
Returns

public List<FileInfo> getFiles (Context context)

Returns all files in the repository

Parameters
context The context
Returns
  • A list of all files in the repository

public boolean isEmpty (Context context)

Checks whether there is any file in the repository.

Parameters
context The context
Returns
  • True if there is no file in the repository

public boolean removeFile (Context context, FileInfo fileToRemove)

Removes the specified file from the repository.

Parameters
context The context
fileToRemove The file to be removed
Returns
  • True if the specified file was in the repository and removed successfully

public List<FileInfo> removeFiles (Context context, List<FileInfo> filesToRemove)

Removes the specified files from the repository.

Parameters
context The context
filesToRemove The list of files to be removed
Returns
  • The list of files that were in the repository and removed successfully

public void saveFiles (Context context, List<FileInfo> files)

Saves the specified files into the repository.

Parameters
context The context
files A list of files to be added into the repository

public int size (Context context)

Returns the number of files in the repository.

Parameters
context The context
Returns
  • The number of files

public boolean updateFile (Context context, FileInfo oldFile, FileInfo newFile)

Updates the file in the repository.

Parameters
context The context
oldFile The old file info
newFile The new file info
Returns
  • True if the file info was updated successfully

public void updateFile (Context context, FileInfo fileInfo)

Updates the information of the specified file in the repository.

Parameters
context The context
fileInfo The file info