org.apache.felix.obrplugin

## Class RemoteFileManager

- java.lang.Object
- - org.apache.felix.obrplugin.RemoteFileManager

-     public class RemoteFileManager
      extends Object

  this class is used to manage all connections by wagon.
  Author:
    Felix Project Team

- - ### Constructor Summary

    Constructors
    Constructor and 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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connect(String id, String url)` connect the current object to repository given in constructor.
    `void` | `disconnect()` disconnect the current object.
    `File` | `get(String url, String suffix)` get a file from the current repository connected.
    `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.
    `boolean` | `isLockedFile(String fileName)` this method indicates if the targeted file is locked or not.
    `void` | `lockFile(String fileName, boolean ignoreLock)`
    `void` | `put(File file, String url)` put a file on the current repository connected.
    `String` | `toString()`
    `void` | `unlockFile(String fileName)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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 maven
        `settings` - settings of the current project provides by maven
        `log` - logger

  - ### Method Detail

    - #### disconnect

          public void disconnect()

      disconnect the current object.

    - #### connect

          public void connect(String id,
                     String url)
                       throws org.apache.maven.plugin.MojoExecutionException

      connect the current object to repository given in constructor.
      Parameters:
        `id` - repository id
        `url` - repository url
      Throws:
        `org.apache.maven.plugin.MojoExecutionException`

    - #### get

          public File get(String url,
                 String suffix)
                   throws org.apache.maven.plugin.MojoExecutionException

      get a file from the current repository connected.
      Parameters:
        `url` - url to the targeted file
        `suffix` - suggested file suffix
      Returns:
        get a file descriptor on the required resource
      Throws:
        `org.apache.maven.plugin.MojoExecutionException`

    - #### put

          public void put(File file,
                 String url)
                   throws org.apache.maven.plugin.MojoExecutionException

      put a file on the current repository connected.
      Parameters:
        `file` - file to upload
        `url` - 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(String fileName,
                      boolean ignoreLock)
                        throws org.apache.maven.plugin.MojoExecutionException

      Throws:
        `org.apache.maven.plugin.MojoExecutionException`

    - #### unlockFile

          public void unlockFile(String fileName)
                          throws org.apache.maven.plugin.MojoExecutionException

      Throws:
        `org.apache.maven.plugin.MojoExecutionException`

    - #### isLockedFile

          public boolean isLockedFile(String fileName)
                               throws org.apache.maven.plugin.MojoExecutionException

      this 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 String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2015. All rights reserved.