Package org.opennms.protocols.sftp
Class Sftp3gppUrlConnection
- java.lang.Object
-
- java.net.URLConnection
-
- org.opennms.protocols.sftp.SftpUrlConnection
-
- org.opennms.protocols.sftp.Sftp3gppUrlConnection
-
public class Sftp3gppUrlConnection extends SftpUrlConnection
The class for managing SFTP.3GPP URL Connection.- Author:
- Alejandro Galue
-
-
Field Summary
-
Fields inherited from class org.opennms.protocols.sftp.SftpUrlConnection
DEFAULT_TIMEOUT
-
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sftp3gppUrlConnection(URL url)
Instantiates a new SFTP+3GPP URL connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteFile(String fileName)
Delete file (from the path defined on the URL).String
get3gppFileName()
Gets the file name for 3GPP-A (NE Mode).InputStream
getFile(String fileName)
Gets the file (from the path defined on the URL).List<String>
getFileList()
Gets the file list (from the path defined on the URL).protected String
getPath()
Gets the path for 3GPP-A (NE Mode).Map<String,String>
getQueryMap()
Gets the properties map from the URL Query..long
getTimeStampFromFile(String fileName)
Gets the time stamp from 3GPP XML file name.-
Methods inherited from class org.opennms.protocols.sftp.SftpUrlConnection
connect, disconnect, getChannel, getInputStream
-
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
-
-
-
Constructor Detail
-
Sftp3gppUrlConnection
protected Sftp3gppUrlConnection(URL url)
Instantiates a new SFTP+3GPP URL connection.- Parameters:
url
- the URL
-
-
Method Detail
-
getPath
protected String getPath() throws SftpUrlException
Gets the path for 3GPP-A (NE Mode).- Overrides:
getPath
in classSftpUrlConnection
- Returns:
- the path for 3GPP-A (NE Mode)
- Throws:
SftpUrlException
- the SFTP URL exception
-
get3gppFileName
public String get3gppFileName() throws SftpUrlException
Gets the file name for 3GPP-A (NE Mode).- Returns:
- the path for 3GPP-A (NE Mode)
- Throws:
SftpUrlException
- the SFTP URL exception
-
getTimeStampFromFile
public long getTimeStampFromFile(String fileName)
Gets the time stamp from 3GPP XML file name.- Parameters:
fileName
- the 3GPP XML file name- Returns:
- the time stamp from file
-
getQueryMap
public Map<String,String> getQueryMap()
Gets the properties map from the URL Query..- Returns:
- the query map
-
getFileList
public List<String> getFileList() throws com.jcraft.jsch.SftpException, IOException
Gets the file list (from the path defined on the URL).- Returns:
- the file list
- Throws:
com.jcraft.jsch.SftpException
- the SFTP exceptionIOException
- Signals that an I/O exception has occurred.
-
deleteFile
public void deleteFile(String fileName) throws com.jcraft.jsch.SftpException, IOException
Delete file (from the path defined on the URL).- Parameters:
fileName
- the file name- Throws:
com.jcraft.jsch.SftpException
- the SFTP exceptionIOException
- Signals that an I/O exception has occurred.
-
getFile
public InputStream getFile(String fileName) throws com.jcraft.jsch.SftpException, IOException
Gets the file (from the path defined on the URL).- Parameters:
fileName
- the file name- Returns:
- the file
- Throws:
com.jcraft.jsch.SftpException
- the SFTP exceptionIOException
- Signals that an I/O exception has occurred.
-
-