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 protectedSftp3gppUrlConnection(java.net.URL url)Instantiates a new SFTP+3GPP URL connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteFile(java.lang.String fileName)Delete file (from the path defined on the URL).java.lang.Stringget3gppFileName()Gets the file name for 3GPP-A (NE Mode).java.io.InputStreamgetFile(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.StringgetPath()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..longgetTimeStampFromFile(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 SftpUrlExceptionGets the path for 3GPP-A (NE Mode).- Overrides:
getPathin classSftpUrlConnection- Returns:
- the path for 3GPP-A (NE Mode)
- Throws:
SftpUrlException- the SFTP URL exception
-
get3gppFileName
public java.lang.String get3gppFileName() throws SftpUrlExceptionGets 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.IOExceptionGets 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.IOExceptionDelete 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.IOExceptionGets 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.
-
-