public class BatchInputFileServiceImpl extends Object implements BatchInputFileService
Modifier and Type | Class and Description |
---|---|
protected class |
BatchInputFileServiceImpl.DoneFilenameFilter
Retrieves files in a directory with the .done extension.
|
Constructor and Description |
---|
BatchInputFileServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
createDoneFile(File batchFile,
BatchInputFileType batchInputFileType)
Creates a '.done' file with the name of the batch file.
|
protected File |
generateDoneFileObject(File batchInputFile,
String fileExtension)
This method is responsible for creating a File object that represents the done file.
|
boolean |
isBatchInputTypeActive(BatchInputFileType batchInputFileType)
Checks if the batch input type is active (can be used for upload).
|
boolean |
isFileUserIdentifierProperlyFormatted(String fileUserIdentifier)
For this implementation, a file user identifier must consist of letters and digits
|
List<String> |
listBatchTypeFilesForUser(BatchInputFileType batchInputFileType,
org.kuali.rice.kim.api.identity.Person user)
Fetches workgroup for batch type from system parameter and verifies user is a member.
|
protected List<File> |
listBatchTypeFilesForUserAsFiles(BatchInputFileType batchInputFileType,
org.kuali.rice.kim.api.identity.Person user) |
protected File[] |
listFilesInBatchTypeDirectory(BatchInputFileType batchInputFileType)
Returns List of filenames for existing files in the directory given by the batch input type.
|
List<String> |
listInputFileNamesWithDoneFile(BatchInputFileType batchInputFileType)
Returns a list of existing input files for the batch type that have an associated .done file
|
Object |
parse(BatchInputFileType batchInputFileType,
byte[] fileByteContent)
Delegates to the batch input file type to parse the file.
|
String |
save(org.kuali.rice.kim.api.identity.Person user,
BatchInputFileType batchInputFileType,
String fileUserIdentifier,
InputStream fileContents,
Object parsedObject)
Stores the inputstream as a file on the server, identified by the given user file name.
|
String |
save(org.kuali.rice.kim.api.identity.Person user,
BatchInputFileType batchInputFileType,
String fileUserIdentifier,
InputStream fileContents,
Object parsedObject,
String destinationFilePath,
String extension)
Stores the inputstream as a file on the server, identified by the given user file name.
|
boolean |
validate(BatchInputFileType batchInputFileType,
Object parsedObject)
Defers to batch type to do any validation on the parsed contents.
|
public BatchInputFileServiceImpl()
public Object parse(BatchInputFileType batchInputFileType, byte[] fileByteContent)
parse
in interface BatchInputFileService
batchInputFileType
- - batch input file type for the file to parsefileByteContent
- - byte contents of file to parseBatchInputFileService.parse(org.kuali.ole.sys.batch.BatchInputFileType, byte[])
public boolean validate(BatchInputFileType batchInputFileType, Object parsedObject)
validate
in interface BatchInputFileService
batchInputFileType
- - instance of a BatchInputFileTypeparsedObject
- - the Object built from parsing xml contentsBatchInputFileService.validate(org.kuali.ole.sys.batch.BatchInputFileType, java.lang.Object)
public String save(org.kuali.rice.kim.api.identity.Person user, BatchInputFileType batchInputFileType, String fileUserIdentifier, InputStream fileContents, Object parsedObject) throws org.kuali.rice.krad.exception.AuthorizationException, FileStorageException
BatchInputFileService
save
in interface BatchInputFileService
user
- - user who is requesting the savebatchInputFileType
- - instance of a BatchInputFileTypefileUserIdentifier
- - file identifier specified by userfileContents
- - contents of the uploaded fileparsedObject
- - object parsed from the input fileFileStorageException
- - if errors were encountered while attempting to write the fileorg.kuali.rice.krad.exception.AuthorizationException
org.kuali.ole.sys.batch.service.BatchInputFileService#save(org.kuali.rice.kim.api.identity.Person,
org.kuali.ole.sys.batch.BatchInputFileType, java.lang.String, java.io.InputStream)
public String save(org.kuali.rice.kim.api.identity.Person user, BatchInputFileType batchInputFileType, String fileUserIdentifier, InputStream fileContents, Object parsedObject, String destinationFilePath, String extension) throws org.kuali.rice.krad.exception.AuthorizationException, FileStorageException
BatchInputFileService
save
in interface BatchInputFileService
user
- - user who is requesting the savebatchInputFileType
- - instance of a BatchInputFileTypefileUserIdentifier
- - file identifier specified by userfileContents
- - contents of the uploaded fileparsedObject
- - object parsed from the input filedestinationFilePath
- - destination path selected by user for storing the ole format xml.extension
- - extension of the file selected through marc file upload screenFileStorageException
- - if errors were encountered while attempting to write the fileorg.kuali.rice.krad.exception.AuthorizationException
org.kuali.ole.sys.batch.service.BatchInputFileService#save(org.kuali.rice.kim.api.identity.Person,
org.kuali.ole.sys.batch.BatchInputFileType, java.lang.String, java.io.InputStream)
protected void createDoneFile(File batchFile, BatchInputFileType batchInputFileType)
protected File generateDoneFileObject(File batchInputFile, String fileExtension)
batchInputFile
- public boolean isBatchInputTypeActive(BatchInputFileType batchInputFileType)
BatchInputFileService
isBatchInputTypeActive
in interface BatchInputFileService
batchInputFileType
- - input type to check is activeBatchInputFileService.isBatchInputTypeActive(org.kuali.ole.sys.batch.BatchInputFileType)
public List<String> listBatchTypeFilesForUser(BatchInputFileType batchInputFileType, org.kuali.rice.kim.api.identity.Person user) throws org.kuali.rice.krad.exception.AuthorizationException
listBatchTypeFilesForUser
in interface BatchInputFileService
user
- - user for checking permissionsorg.kuali.rice.krad.exception.AuthorizationException
BatchInputFileService.listBatchTypeFilesForUser(org.kuali.ole.sys.batch.BatchInputFileType,
org.kuali.rice.kim.api.identity.Person)
protected List<File> listBatchTypeFilesForUserAsFiles(BatchInputFileType batchInputFileType, org.kuali.rice.kim.api.identity.Person user) throws org.kuali.rice.krad.exception.AuthorizationException
org.kuali.rice.krad.exception.AuthorizationException
protected File[] listFilesInBatchTypeDirectory(BatchInputFileType batchInputFileType)
public List<String> listInputFileNamesWithDoneFile(BatchInputFileType batchInputFileType)
BatchInputFileService
listInputFileNamesWithDoneFile
in interface BatchInputFileService
batchInputFileType
- - batch type to retieve files forBatchInputFileService.listInputFileNamesWithDoneFile(org.kuali.ole.sys.batch.BatchInputFileType)
public boolean isFileUserIdentifierProperlyFormatted(String fileUserIdentifier)
isFileUserIdentifierProperlyFormatted
in interface BatchInputFileService
BatchInputFileService.isFileUserIdentifierProperlyFormatted(java.lang.String)
Copyright © 2004–2015 The Kuali Foundation. All rights reserved.