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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sftp3gppUrlConnection(java.net.URL url)
Instantiates a new SFTP+3GPP URL connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteFile(java.lang.String fileName)
Delete file (from the path defined on the URL).java.lang.String
get3gppFileName()
Gets the file name for 3GPP-A (NE Mode).java.io.InputStream
getFile(java.lang.String fileName)
Gets the file (from the path defined on the URL).java.util.List<java.lang.String>
getFileList()
Gets the file list (from the path defined on the URL).protected java.lang.String
getPath()
Gets the path for 3GPP-A (NE Mode).java.util.Map<java.lang.String,java.lang.String>
getQueryMap()
Gets the properties map from the URL Query..long
getTimeStampFromFile(java.lang.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
-
-
-
-
Method Detail
-
getPath
protected java.lang.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 java.lang.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(java.lang.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 java.util.Map<java.lang.String,java.lang.String> getQueryMap()
Gets the properties map from the URL Query..- Returns:
- the query map
-
getFileList
public java.util.List<java.lang.String> getFileList() throws com.jcraft.jsch.SftpException, java.io.IOException
Gets the file list (from the path defined on the URL).- Returns:
- the file list
- Throws:
com.jcraft.jsch.SftpException
- the SFTP exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
deleteFile
public void deleteFile(java.lang.String fileName) throws com.jcraft.jsch.SftpException, java.io.IOException
Delete file (from the path defined on the URL).- Parameters:
fileName
- the file name- Throws:
com.jcraft.jsch.SftpException
- the SFTP exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
getFile
public java.io.InputStream getFile(java.lang.String fileName) throws com.jcraft.jsch.SftpException, java.io.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 exceptionjava.io.IOException
- Signals that an I/O exception has occurred.
-
-