Interface ISourceFile
-
- All Known Implementing Classes:
EntityFile
public interface ISourceFile
Interface for accessing the data from an individual source file from a submission
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(ISourceFile file)
File equality checklong
getArchiveId()
Get the id for the immediate parent submission, this may not be the top level submission seen by the userjava.lang.String
getDisplayFileSize(boolean si)
Fetches the file size in String form with the correct extensionjava.io.InputStream
getFileContents()
java.lang.String
getFileContentsAsString()
java.util.List<java.lang.String>
getFileContentsAsStringList()
java.lang.String
getFileDisplayName()
java.lang.String
getFileDisplayPath()
java.lang.String
getFileIdentifier()
long
getFileSize()
Fetches the file size in bytesint
getNonEmptyLineCount()
Count of the number of lines in the file containing characters, non emptylong
getPersistentId()
ISubmission
getSubmission()
Get the top level, "super parent", submission object, this is the submission for this file seen by the user, NOT a sub-directoryint
getTotalLineCount()
Count of the total number of lines in the filevoid
remove()
Remove the file
-
-
-
Method Detail
-
equals
boolean equals(ISourceFile file)
File equality check- Parameters:
file
- file to compare- Returns:
- equals
-
getFileContents
java.io.InputStream getFileContents()
- Returns:
- the content of the file
-
getFileContentsAsString
java.lang.String getFileContentsAsString()
- Returns:
- the content of the file as a string
-
getFileContentsAsStringList
java.util.List<java.lang.String> getFileContentsAsStringList()
- Returns:
- the content of the file as a list of strings
-
getFileIdentifier
java.lang.String getFileIdentifier()
- Returns:
- a web path safe file identifier
-
getFileDisplayName
java.lang.String getFileDisplayName()
- Returns:
- string containing display formatted file name
-
getFileDisplayPath
java.lang.String getFileDisplayPath()
- Returns:
- string containing display formatted file path
-
getPersistentId
long getPersistentId()
- Returns:
- fetches a unique, persistent id for the file. No other file should EVER be able to take this ID, even if this file is deleted.
-
getArchiveId
long getArchiveId()
Get the id for the immediate parent submission, this may not be the top level submission seen by the user- Returns:
- the id for the submission
-
getSubmission
ISubmission getSubmission()
Get the top level, "super parent", submission object, this is the submission for this file seen by the user, NOT a sub-directory- Returns:
- the highest level parent submission
-
remove
void remove()
Remove the file
-
getNonEmptyLineCount
int getNonEmptyLineCount()
Count of the number of lines in the file containing characters, non empty- Returns:
- count of non empty lines
-
getTotalLineCount
int getTotalLineCount()
Count of the total number of lines in the file- Returns:
- count of all lines
-
getFileSize
long getFileSize()
Fetches the file size in bytes- Returns:
- file size in bytes
-
getDisplayFileSize
java.lang.String getDisplayFileSize(boolean si)
Fetches the file size in String form with the correct extension- Parameters:
si
- use SI (1000) or binary (1024) for calculations- Returns:
- string for the file size
-
-