Interface ISourceFile
-
- All Known Implementing Classes:
EntityFile
public interface ISourceFileInterface 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 booleanequals(ISourceFile file)File equality checklonggetArchiveId()Get the id for the immediate parent submission, this may not be the top level submission seen by the userjava.lang.StringgetDisplayFileSize(boolean si)Fetches the file size in String form with the correct extensionjava.io.InputStreamgetFileContents()java.lang.StringgetFileContentsAsString()java.util.List<java.lang.String>getFileContentsAsStringList()java.lang.StringgetFileDisplayName()java.lang.StringgetFileDisplayPath()java.lang.StringgetFileIdentifier()longgetFileSize()Fetches the file size in bytesintgetNonEmptyLineCount()Count of the number of lines in the file containing characters, non emptylonggetPersistentId()ISubmissiongetSubmission()Get the top level, "super parent", submission object, this is the submission for this file seen by the user, NOT a sub-directoryintgetTotalLineCount()Count of the total number of lines in the filevoidremove()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
-
-