public class

ExternalFileInfo

extends Object
implements BaseFileInfo Cloneable
java.lang.Object
   ↳ com.pdftron.pdf.model.ExternalFileInfo

Class Overview

Facility class for files stored in external storage.

Summary

[Expand]
Inherited Constants
From interface com.pdftron.pdf.model.BaseFileInfo
Public Constructors
ExternalFileInfo(Context context)
Class constructor
ExternalFileInfo(Context context, ExternalFileInfo parent, Uri uri)
Class consturctor
Public Methods
static Uri appendPathComponent(Uri baseUri, String component)
Returns the appended path component to the specified URI.
ExternalFileInfo buildTree(Uri uri)
Given the specified uri, builds its corresponding ExternalFile, complete with a reverse mapping to this file.
ExternalFileInfo clone()
Clone file.
ExternalFileInfo createDirectory(String displayName)
Creates a directory.
ExternalFileInfo createFile(String mimeType, String displayName)
Creates a new file as a direct child of this directory.
boolean delete()
Deletes the file.
boolean exists()
The overloaded implementation of exists().
ExternalFileInfo findFile(String displayName)
Searches this folder for the given display name.
String getAbsolutePath()
The overloaded implementation of getAbsolutePath().
Context getContext()
Gets the context
String getDocumentPath()
Gets document path
String getExtension()
ExternalFileInfo getFile(String displayName)
A special version of listFiles() that only creates one file.
int[] getFileCount()
String getFileName()
The overloaded implementation of getFileName().
int getFileType()
The overloaded implementation of getFileType().
String getHeaderText()
String getIdentifier()
String getModifiedDate()
The overloaded implementation of getModifiedDate().
String getName()
Gets file name
ExternalFileInfo getParent()
Gets the parent file
String getParentRelativePath()
Gets parent directory's relative path
static String getParentRelativePath(Uri uri, String name)
Gets parent directory's relative path
Long getRawModifiedDate()
Gets raw modified date
Uri getRootUri()
Gets root URI
long getSize()
Gets file size
String getSizeInfo()
The overloaded implementation of getSizeInfo().
String getTreePath()
Gets tree path
String getType()
Gets file mime type
Uri getUri()
Gets the URI
static String getUriMimeType(Context context, String encodedUri)
Returns the URI mime type of the specified URI
String getVolume()
Gets file volumn
void initFields()
Initializes the fields by using the specified URI.
boolean isDirectory()
Whether it is a directory
boolean isEarlierHeading()
boolean isHeader()
boolean isHidden()
Whether if this file is hidden
boolean isPackage()
The overloaded implementation of isPackage().
boolean isSecured()
The overloaded implementation of isSecured().
boolean isThisWeekHeading()
boolean isTodayHeading()
ArrayList<ExternalFileInfo> listFiles()
Gets contained list of files and folders.
boolean renameTo(String displayName)
Rename file.
void setHidden(boolean isHidden)
Hide/ Reveal this file
void setIsPackage(boolean value)
The overloaded implementation of setIsPackage(boolean).
void setIsSecured(boolean value)
The overloaded implementation of setIsSecured(boolean).
void setRootUri(Uri rootUri)
Sets the root URI.
void setUri(Uri uri)
Sets the URI.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.pdf.model.BaseFileInfo

Public Constructors

public ExternalFileInfo (Context context)

Class constructor

Parameters
context The context

public ExternalFileInfo (Context context, ExternalFileInfo parent, Uri uri)

Class consturctor

Parameters
context The context
parent parent file
uri uri of this file info

Public Methods

public static Uri appendPathComponent (Uri baseUri, String component)

Returns the appended path component to the specified URI.

Parameters
baseUri The base URI
component The component
Returns
  • The appended path component

public ExternalFileInfo buildTree (Uri uri)

Given the specified uri, builds its corresponding ExternalFile, complete with a reverse mapping to this file.

Note that this should be executed in a background thread.

Parameters
uri The URI
Returns
  • The tree file

public ExternalFileInfo clone ()

Clone file.

Returns
  • A new file with exact properties

public ExternalFileInfo createDirectory (String displayName)

Creates a directory.

Note that this should be executed in a background thread.

Parameters
displayName The display name
Returns
  • The created directory

public ExternalFileInfo createFile (String mimeType, String displayName)

Creates a new file as a direct child of this directory.

Note that this should be executed in a background thread.

Parameters
mimeType The mime type
displayName The display name
Returns
  • The new file

public boolean delete ()

Deletes the file.

Returns
  • True if successful

public boolean exists ()

The overloaded implementation of exists().

public ExternalFileInfo findFile (String displayName)

Searches this folder for the given display name.

Note that this should be executed in a background thread.

Parameters
displayName The display name
Returns
  • The list of files match the given display name

public String getAbsolutePath ()

The overloaded implementation of getAbsolutePath().

public Context getContext ()

Gets the context

Returns
  • The context

public String getDocumentPath ()

Gets document path

Returns
  • The document path

public String getExtension ()

Returns
  • the file extension

public ExternalFileInfo getFile (String displayName)

A special version of listFiles() that only creates one file.

Note that this should be executed in a background thread.

Parameters
displayName The display name
Returns
  • A file that match the specified display name

public int[] getFileCount ()

Returns
  • The number of files (the first element) and folders (the second element) under this file.

public String getFileName ()

The overloaded implementation of getFileName().

public int getFileType ()

The overloaded implementation of getFileType().

public String getHeaderText ()

public String getIdentifier ()

public String getModifiedDate ()

The overloaded implementation of getModifiedDate().

public String getName ()

Gets file name

Returns
  • The name of file

public ExternalFileInfo getParent ()

Gets the parent file

Returns
  • The parent file.

public String getParentRelativePath ()

Gets parent directory's relative path

Returns
  • The parent directory's relative path

public static String getParentRelativePath (Uri uri, String name)

Gets parent directory's relative path

Returns
  • The parent directory's relative path

public Long getRawModifiedDate ()

Gets raw modified date

Returns
  • The raw modified date

public Uri getRootUri ()

Gets root URI

Returns
  • The root URI.

public long getSize ()

Gets file size

Returns
  • The size of file

public String getSizeInfo ()

The overloaded implementation of getSizeInfo(). Gets size in string format of this file

public String getTreePath ()

Gets tree path

Returns
  • The tree path

public String getType ()

Gets file mime type

Returns
  • The mime type of file

public Uri getUri ()

Gets the URI

Returns
  • The URI

public static String getUriMimeType (Context context, String encodedUri)

Returns the URI mime type of the specified URI

Parameters
context The context
encodedUri The encoded URI
Returns
  • The URI mime type

public String getVolume ()

Gets file volumn

Returns
  • The volume

public void initFields ()

Initializes the fields by using the specified URI.

public boolean isDirectory ()

Whether it is a directory

Returns
  • True if the file is directory

public boolean isEarlierHeading ()

public boolean isHeader ()

public boolean isHidden ()

Whether if this file is hidden

Returns
  • true if it is a hidden file

public boolean isPackage ()

The overloaded implementation of isPackage().

public boolean isSecured ()

The overloaded implementation of isSecured().

public boolean isThisWeekHeading ()

public boolean isTodayHeading ()

public ArrayList<ExternalFileInfo> listFiles ()

Gets contained list of files and folders.

Note that this should be executed in a background thread.

Returns
  • a list of files and folders in this folder.

public boolean renameTo (String displayName)

Rename file.

Parameters
displayName The new display name
Returns
  • True if successful

public void setHidden (boolean isHidden)

Hide/ Reveal this file

Parameters
isHidden whether to hide this file

public void setIsPackage (boolean value)

The overloaded implementation of setIsPackage(boolean).

Parameters
value True if the file is a package

public void setIsSecured (boolean value)

The overloaded implementation of setIsSecured(boolean).

Parameters
value True if the file is secured

public void setRootUri (Uri rootUri)

Sets the root URI.

Parameters
rootUri The root URI

public void setUri (Uri uri)

Sets the URI.

Parameters
uri The URI