|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.kfs.sys.batch.service.impl.BatchInputFileServiceImpl
public class BatchInputFileServiceImpl
Provides batch input file management, including listing files, parsing, downloading, storing, and deleting.
| Nested Class Summary | |
|---|---|
protected class |
BatchInputFileServiceImpl.DoneFilenameFilter
Retrieves files in a directory with the .done extension. |
| Constructor Summary | |
|---|---|
BatchInputFileServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
createDoneFile(File batchFile)
Creates a '.done' file with the name of the batch file. |
protected File |
generateDoneFileObject(File batchInputFile)
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.bo.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.bo.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.bo.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. |
boolean |
validate(BatchInputFileType batchInputFileType,
Object parsedObject)
Defers to batch type to do any validation on the parsed contents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatchInputFileServiceImpl()
| Method Detail |
|---|
public Object parse(BatchInputFileType batchInputFileType,
byte[] fileByteContent)
parse in interface BatchInputFileServicebatchInputFileType - - batch input file type for the file to parsefileByteContent - - byte contents of file to parse
BatchInputFileService.parse(org.kuali.kfs.sys.batch.BatchInputFileType, byte[])
public boolean validate(BatchInputFileType batchInputFileType,
Object parsedObject)
validate in interface BatchInputFileServicebatchInputFileType - - instance of a BatchInputFileTypeparsedObject - - the Object built from parsing xml contents
BatchInputFileService.validate(org.kuali.kfs.sys.batch.BatchInputFileType, java.lang.Object)
public String save(org.kuali.rice.kim.bo.Person user,
BatchInputFileType batchInputFileType,
String fileUserIdentifier,
InputStream fileContents,
Object parsedObject)
throws org.kuali.rice.kns.exception.AuthorizationException,
FileStorageException
BatchInputFileService
save in interface BatchInputFileServiceuser - - 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 file
FileStorageException - - if errors were encountered while attempting to write the file
org.kuali.rice.kns.exception.AuthorizationExceptionorg.kuali.kfs.sys.batch.service.BatchInputFileService#save(org.kuali.rice.kim.bo.Person,
org.kuali.kfs.sys.batch.BatchInputFileType, java.lang.String, java.io.InputStream)protected void createDoneFile(File batchFile)
protected File generateDoneFileObject(File batchInputFile)
batchInputFile -
public boolean isBatchInputTypeActive(BatchInputFileType batchInputFileType)
BatchInputFileService
isBatchInputTypeActive in interface BatchInputFileServicebatchInputFileType - - input type to check is active
BatchInputFileService.isBatchInputTypeActive(org.kuali.kfs.sys.batch.BatchInputFileType)
public List<String> listBatchTypeFilesForUser(BatchInputFileType batchInputFileType,
org.kuali.rice.kim.bo.Person user)
throws org.kuali.rice.kns.exception.AuthorizationException
listBatchTypeFilesForUser in interface BatchInputFileServiceuser - - user for checking permissions
org.kuali.rice.kns.exception.AuthorizationExceptionBatchInputFileService.listBatchTypeFilesForUser(org.kuali.kfs.sys.batch.BatchInputFileType,
org.kuali.rice.kim.bo.Person)
protected List<File> listBatchTypeFilesForUserAsFiles(BatchInputFileType batchInputFileType,
org.kuali.rice.kim.bo.Person user)
throws org.kuali.rice.kns.exception.AuthorizationException
org.kuali.rice.kns.exception.AuthorizationExceptionprotected File[] listFilesInBatchTypeDirectory(BatchInputFileType batchInputFileType)
public List<String> listInputFileNamesWithDoneFile(BatchInputFileType batchInputFileType)
BatchInputFileService
listInputFileNamesWithDoneFile in interface BatchInputFileServicebatchInputFileType - - batch type to retieve files for
BatchInputFileService.listInputFileNamesWithDoneFile(org.kuali.kfs.sys.batch.BatchInputFileType)public boolean isFileUserIdentifierProperlyFormatted(String fileUserIdentifier)
isFileUserIdentifierProperlyFormatted in interface BatchInputFileServiceBatchInputFileService.isFileUserIdentifierProperlyFormatted(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||