public class LocalFileService extends Object implements FileService, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
FileService
that deals with files only in the
local file system. Files and triggers are created in subdirectories of the
Java temporary directory.Constructor and Description |
---|
LocalFileService() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
int |
countFiles() |
FileInfo |
createFile(String path) |
int |
delete(String pattern) |
List<FileInfo> |
getFiles(int startFile,
int pageSize) |
org.springframework.core.io.Resource |
getResource(String path) |
File |
getUploadDirectory() |
boolean |
publish(FileInfo dest) |
void |
setFileSender(FileSender fileSender) |
void |
setOutputDir(File outputDir)
The output directory to store new files.
|
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public void setFileSender(FileSender fileSender)
public void setOutputDir(File outputDir)
${java.io.tmpdir}/batch/files
.outputDir
- the output directory to setpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public FileInfo createFile(String path) throws IOException
createFile
in interface FileService
IOException
public boolean publish(FileInfo dest) throws IOException
publish
in interface FileService
IOException
public int countFiles()
countFiles
in interface FileService
public List<FileInfo> getFiles(int startFile, int pageSize) throws IOException
getFiles
in interface FileService
IOException
public int delete(String pattern) throws IOException
delete
in interface FileService
IOException
public org.springframework.core.io.Resource getResource(String path)
getResource
in interface FileService
public File getUploadDirectory()
Copyright © 2015. All rights reserved.