org.springframework.batch.admin.service
Class LocalFileService

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

public class LocalFileService
extends Object
implements FileService, org.springframework.beans.factory.InitializingBean, org.springframework.context.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)
           
 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)
           
 
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(org.springframework.core.io.ResourceLoader resourceLoader)
Specified by:
setResourceLoader in interface org.springframework.context.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 org.springframework.beans.factory.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 org.springframework.core.io.Resource getResource(String path)
Specified by:
getResource in interface FileService

getUploadDirectory

public File getUploadDirectory()


Copyright © 2013. All Rights Reserved.