| org.kuali.kfs.service.BatchInputFileService
All known Subclasses: org.kuali.kfs.service.impl.BatchInputFileServiceImpl,
BatchInputFileService | public interface BatchInputFileService (Code) | | Interface defining methods to manage batch input files.
|
Method Summary | |
public boolean | delete(UniversalUser user, BatchInputFileType inputType, String deleteFileNameWithNoPath) Deletes a batch input file contained on the server if the user has permissions for the files batch input type. | public File | download(UniversalUser user, BatchInputFileType inputType, String downloadFileName) Returns the contents of a batch input file contained on the server if the user has permissions for the files batch input
type.
Parameters: user - - user who is requesting the download Parameters: inputType - - instance of a BatchInputFileType Parameters: downloadFileNameWithNoPath - - name of the file to retrieve, with no path information File - File representation of the batch input, or null if errors occured. | public boolean | hasBeenProcessed(BatchInputFileType inputType, String fileNameWithNoPath) | public boolean | isBatchInputTypeActive(BatchInputFileType batchInputFileType) Checks if the batch input type is active (can be used for upload). | public boolean | isFileUserIdentifierProperlyFormatted(String fileUserIdentifier) Returns whether a file user identifier is properly formatted. | public boolean | isUserAuthorizedForBatchType(BatchInputFileType batchInputFileType, UniversalUser user) Checks if the user has permissions to manage the batch input type. | public List<String> | listBatchTypeFilesForUser(BatchInputFileType batchInputFileType, UniversalUser user) Returns a list of batch type file names (without path) that the given user has permissions to manage. | public List<String> | listInputFileNamesWithDoneFile(BatchInputFileType batchInputFileType) | public Object | parse(BatchInputFileType batchInputFileType, byte[] fileByteContent) Unmarshalls the file contents to an Object using the digestor and digestor rules file specified in the batch input type. | public String | save(UniversalUser user, BatchInputFileType inputType, String fileUserIdentifier, InputStream fileContents, Object parsedObject) Stores the inputstream as a file on the server, identified by the given user file name. | public boolean | validate(BatchInputFileType inputType, Object parsedObject) Using the input type object parses and validates the file contents by calling validate on the batch input type. |
delete | public boolean delete(UniversalUser user, BatchInputFileType inputType, String deleteFileNameWithNoPath) throws AuthorizationException, FileNotFoundException(Code) | | Deletes a batch input file contained on the server if the user has permissions for the files batch input type. Also deletes
the associated .done file if one exists. If deletion fails, this method will place the reason for failure in the
GlobalVariables error map.
Parameters: user - - user who is requesting the delete Parameters: inputType - - instance of a BatchInputFileType Parameters: deleteFileNameWithNoPath - - name of the file to remove, with no path information whether the file (and its done file) was deleted throws: AuthorizationException - - if user does not have permission to delete batch files of this type FileNotFoundException -if given file does not exist on the file system |
download | public File download(UniversalUser user, BatchInputFileType inputType, String downloadFileName) throws AuthorizationException, FileNotFoundException(Code) | | Returns the contents of a batch input file contained on the server if the user has permissions for the files batch input
type.
Parameters: user - - user who is requesting the download Parameters: inputType - - instance of a BatchInputFileType Parameters: downloadFileNameWithNoPath - - name of the file to retrieve, with no path information File - File representation of the batch input, or null if errors occured. Check GlobalVariables.errorMap for errormessages. throws: AuthorizationException - - if user does not have permission to view batch files of this type FileNotFoundException - ifgiven file does not exist on the file system |
hasBeenProcessed | public boolean hasBeenProcessed(BatchInputFileType inputType, String fileNameWithNoPath)(Code) | | Returns whether a the given file has been processed by the associated batch job
Parameters: inputType - Parameters: fileNameWithNoPath - |
isBatchInputTypeActive | public boolean isBatchInputTypeActive(BatchInputFileType batchInputFileType)(Code) | | Checks if the batch input type is active (can be used for upload).
Parameters: batchInputFileType - - input type to check is active boolean - true if type is active, false if not active |
isFileUserIdentifierProperlyFormatted | public boolean isFileUserIdentifierProperlyFormatted(String fileUserIdentifier)(Code) | | Returns whether a file user identifier is properly formatted.
Parameters: fileUserIdentifier - |
isUserAuthorizedForBatchType | public boolean isUserAuthorizedForBatchType(BatchInputFileType batchInputFileType, UniversalUser user)(Code) | | Checks if the user has permissions to manage the batch input type.
Parameters: batchInputFileType - - input type to check user permissions on Parameters: user - - user to check boolean - true if user has permissions for the type, false if the user does not have permission |
listBatchTypeFilesForUser | public List<String> listBatchTypeFilesForUser(BatchInputFileType batchInputFileType, UniversalUser user) throws AuthorizationException(Code) | | Returns a list of batch type file names (without path) that the given user has permissions to manage. Path is intentionally
excluded to prevent security problems arising from giving users access to the full path.
Parameters: user - - user for checking permissions List - List of filenames |
listInputFileNamesWithDoneFile | public List<String> listInputFileNamesWithDoneFile(BatchInputFileType batchInputFileType)(Code) | | Returns a list of existing input files for the batch type that have an associated .done file
Parameters: batchInputFileType - - batch type to retieve files for List - List of filenames |
parse | public Object parse(BatchInputFileType batchInputFileType, byte[] fileByteContent) throws XMLParseException(Code) | | Unmarshalls the file contents to an Object using the digestor and digestor rules file specified in the batch input type.
Parameters: batchInputFileType - - batch input file type for the file to parse Parameters: fileByteContent - - byte contents of file to parse - Object built from the file contents based on its xml unmarshalling rules throws: XMLParseException - - if there were errors encountered during parsing of the xml |
save | public String save(UniversalUser user, BatchInputFileType inputType, String fileUserIdentifier, InputStream fileContents, Object parsedObject) throws AuthorizationException, FileStorageException(Code) | | Stores the inputstream as a file on the server, identified by the given user file name.
Parameters: user - - user who is requesting the save Parameters: inputType - - instance of a BatchInputFileType Parameters: fileUserIdentifier - - file identifier specified by user Parameters: fileContents - - contents of the uploaded file Parameters: parsedObject - - object parsed from the input file String - name of file that was saved, or null if errors were enountered throws: FileStorageException - - if errors were encountered while attempting to write the file |
validate | public boolean validate(BatchInputFileType inputType, Object parsedObject)(Code) | | Using the input type object parses and validates the file contents by calling validate on the batch input type. If there were
validation errors, GlobalVariables.errorMap will contain the error messages.
Parameters: inputType - - instance of a BatchInputFileType Parameters: parsedObject - - the Object built from parsing xml contents boolean - true if validation was successful, false if there were errors |
|
|