Class FileServiceBridge
- java.lang.Object
-
- org.onebusaway.admin.service.impl.FileServiceBridge
-
- All Implemented Interfaces:
FileService
,org.springframework.beans.factory.Aware
,org.springframework.web.context.ServletContextAware
public class FileServiceBridge extends Object implements FileService, org.springframework.web.context.ServletContextAware
-
-
Constructor Summary
Constructors Constructor Description FileServiceBridge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bundleDirectoryExists(String filename)
boolean
createBundleDirectory(String filename)
String
createOutputFilesZip(String directoryName)
Creates a zip of all the output files generated in the given bundle directory during bundle building processboolean
deleteBundleDirectory(String filename)
InputStream
get(String s3Path)
String
get(String basePath, String tmpDir)
String
getAuxPath()
String
getBucketName()
String
getBuildPath()
String
getBundleDirTimestamp(String dir)
String
getConfigPath()
String
getGtfsPath()
List<String>
list(String directory, int maxResults)
List<String[]>
listBundleDirectories(int maxResults)
String
put(String key, String directory)
void
setAuxPath(String auxPath)
void
setBucketName(String bucketName)
void
setBuildPath(String buildPath)
void
setConfigPath(String configPath)
void
setGtfsPath(String gtfsPath)
void
setPassword(String password)
void
setServletContext(javax.servlet.ServletContext servletContext)
void
setup()
void
setUser(String user)
void
validateFileName(String fileName)
Validates that given file name does not contain characters which could lead to directory traversal attack.
-
-
-
Method Detail
-
setup
@PostConstruct public void setup()
- Specified by:
setup
in interfaceFileService
-
setUser
public void setUser(String user)
- Specified by:
setUser
in interfaceFileService
-
setPassword
public void setPassword(String password)
- Specified by:
setPassword
in interfaceFileService
-
setBucketName
public void setBucketName(String bucketName)
- Specified by:
setBucketName
in interfaceFileService
-
setGtfsPath
public void setGtfsPath(String gtfsPath)
- Specified by:
setGtfsPath
in interfaceFileService
-
getGtfsPath
public String getGtfsPath()
- Specified by:
getGtfsPath
in interfaceFileService
-
setAuxPath
public void setAuxPath(String auxPath)
- Specified by:
setAuxPath
in interfaceFileService
-
getAuxPath
public String getAuxPath()
- Specified by:
getAuxPath
in interfaceFileService
-
setBuildPath
public void setBuildPath(String buildPath)
- Specified by:
setBuildPath
in interfaceFileService
-
getConfigPath
public String getConfigPath()
- Specified by:
getConfigPath
in interfaceFileService
-
setConfigPath
public void setConfigPath(String configPath)
- Specified by:
setConfigPath
in interfaceFileService
-
getBuildPath
public String getBuildPath()
- Specified by:
getBuildPath
in interfaceFileService
-
getBucketName
public String getBucketName()
- Specified by:
getBucketName
in interfaceFileService
-
bundleDirectoryExists
public boolean bundleDirectoryExists(String filename)
- Specified by:
bundleDirectoryExists
in interfaceFileService
-
createBundleDirectory
public boolean createBundleDirectory(String filename)
- Specified by:
createBundleDirectory
in interfaceFileService
-
deleteBundleDirectory
public boolean deleteBundleDirectory(String filename)
- Specified by:
deleteBundleDirectory
in interfaceFileService
-
listBundleDirectories
public List<String[]> listBundleDirectories(int maxResults)
- Specified by:
listBundleDirectories
in interfaceFileService
-
getBundleDirTimestamp
public String getBundleDirTimestamp(String dir)
- Specified by:
getBundleDirTimestamp
in interfaceFileService
-
get
public String get(String basePath, String tmpDir)
- Specified by:
get
in interfaceFileService
-
get
public InputStream get(String s3Path)
- Specified by:
get
in interfaceFileService
-
put
public String put(String key, String directory)
- Specified by:
put
in interfaceFileService
-
list
public List<String> list(String directory, int maxResults)
- Specified by:
list
in interfaceFileService
-
createOutputFilesZip
public String createOutputFilesZip(String directoryName)
Description copied from interface:FileService
Creates a zip of all the output files generated in the given bundle directory during bundle building process- Specified by:
createOutputFilesZip
in interfaceFileService
- Parameters:
directoryName
- bundle outpur directory name- Returns:
- name of the zip file created
-
validateFileName
public void validateFileName(String fileName)
Description copied from interface:FileService
Validates that given file name does not contain characters which could lead to directory traversal attack.- Specified by:
validateFileName
in interfaceFileService
- Parameters:
fileName
- the given file name
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-
-