org.springframework.batch.admin.service
Class LocalFileService

java.lang.Object
  extended by org.springframework.batch.admin.service.LocalFileService
All Implemented Interfaces:
FileService, InitializingBean, ResourceLoaderAware

public class LocalFileService
extends Object
implements FileService, InitializingBean, ResourceLoaderAware

An implementation of FileService that deals with files only in the local file system. Files and triggers are created in subdirectories of the Java temporary directory.

Author:
Dave Syer

Constructor Summary
LocalFileService()
           
 
Method Summary
 void afterPropertiesSet()
           
 int countFiles()
           
 FileInfo createFile(String path)
           
 int delete(String pattern)
           
 List<FileInfo> getFiles(int startFile, int pageSize)
           
 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(ResourceLoader resourceLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalFileService

public LocalFileService()
Method Detail

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Specified by:
setResourceLoader in interface ResourceLoaderAware

setFileSender

public void setFileSender(FileSender fileSender)

setOutputDir

public void setOutputDir(File outputDir)
The output directory to store new files. Defaults to ${java.io.tmpdir}/batch/files.

Parameters:
outputDir - the output directory to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

createFile

public FileInfo createFile(String path)
                    throws IOException
Specified by:
createFile in interface FileService
Throws:
IOException

publish

public boolean publish(FileInfo dest)
                throws IOException
Specified by:
publish in interface FileService
Throws:
IOException

countFiles

public int countFiles()
Specified by:
countFiles in interface FileService

getFiles

public List<FileInfo> getFiles(int startFile,
                               int pageSize)
                        throws IOException
Specified by:
getFiles in interface FileService
Throws:
IOException

delete

public int delete(String pattern)
           throws IOException
Specified by:
delete in interface FileService
Throws:
IOException

getResource

public Resource getResource(String path)
Specified by:
getResource in interface FileService

getUploadDirectory

public File getUploadDirectory()


Copyright © 2011. All Rights Reserved.