Package org.apache.felix.obrplugin
Class RemoteFileManager
- java.lang.Object
-
- org.apache.felix.obrplugin.RemoteFileManager
-
public class RemoteFileManager extends java.lang.Objectthis class is used to manage all connections by wagon.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.maven.plugin.logging.Logm_loglogger instance.private org.apache.maven.settings.Settingsm_settingsthe project settings.private org.apache.maven.wagon.Wagonm_wagonsave the connection.private org.apache.maven.artifact.manager.WagonManagerm_wagonManagerthe wagon manager.
-
Constructor Summary
Constructors Constructor Description RemoteFileManager(org.apache.maven.artifact.manager.WagonManager wm, org.apache.maven.settings.Settings settings, org.apache.maven.plugin.logging.Log log)initialize main information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect(java.lang.String id, java.lang.String url)connect the current object to repository given in constructor.voiddisconnect()disconnect the current object.java.io.Fileget(java.lang.String url, java.lang.String suffix)get a file from the current repository connected.static org.apache.maven.wagon.proxy.ProxyInfogetProxyInfo(org.apache.maven.settings.Settings settings)Convenience method to map a Proxy object from the user system settings to a ProxyInfo object.booleanisLockedFile(java.lang.String fileName)this method indicates if the targeted file is locked or not.voidlockFile(java.lang.String fileName, boolean ignoreLock)voidput(java.io.File file, java.lang.String url)put a file on the current repository connected.java.lang.StringtoString()voidunlockFile(java.lang.String fileName)
-
-
-
Field Detail
-
m_wagon
private org.apache.maven.wagon.Wagon m_wagon
save the connection.
-
m_wagonManager
private org.apache.maven.artifact.manager.WagonManager m_wagonManager
the wagon manager.
-
m_settings
private org.apache.maven.settings.Settings m_settings
the project settings.
-
m_log
private org.apache.maven.plugin.logging.Log m_log
logger instance.
-
-
Constructor Detail
-
RemoteFileManager
public RemoteFileManager(org.apache.maven.artifact.manager.WagonManager wm, org.apache.maven.settings.Settings settings, org.apache.maven.plugin.logging.Log log)initialize main information.- Parameters:
wm- WagonManager provides by mavensettings- settings of the current project provides by mavenlog- logger
-
-
Method Detail
-
disconnect
public void disconnect()
disconnect the current object.
-
connect
public void connect(java.lang.String id, java.lang.String url) throws org.apache.maven.plugin.MojoExecutionExceptionconnect the current object to repository given in constructor.- Parameters:
id- repository idurl- repository url- Throws:
org.apache.maven.plugin.MojoExecutionException
-
get
public java.io.File get(java.lang.String url, java.lang.String suffix) throws org.apache.maven.plugin.MojoExecutionExceptionget a file from the current repository connected.- Parameters:
url- url to the targeted filesuffix- suggested file suffix- Returns:
- get a file descriptor on the required resource
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
put
public void put(java.io.File file, java.lang.String url) throws org.apache.maven.plugin.MojoExecutionExceptionput a file on the current repository connected.- Parameters:
file- file to uploadurl- url to copy file- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getProxyInfo
public static org.apache.maven.wagon.proxy.ProxyInfo getProxyInfo(org.apache.maven.settings.Settings settings)
Convenience method to map a Proxy object from the user system settings to a ProxyInfo object.- Parameters:
settings- project settings given by maven- Returns:
- a proxyInfo object instancied or null if no active proxy is define in the settings.xml
-
lockFile
public void lockFile(java.lang.String fileName, boolean ignoreLock) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
unlockFile
public void unlockFile(java.lang.String fileName) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isLockedFile
public boolean isLockedFile(java.lang.String fileName) throws org.apache.maven.plugin.MojoExecutionExceptionthis method indicates if the targeted file is locked or not.- Parameters:
fileName- name targeted- Returns:
- true if the required file is locked, else false
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-