Remote Systems
v6.4.1

com.ibm.etools.systems.files.util
Class UniversalFileTransferUtility

java.lang.Object
  extended bycom.ibm.etools.systems.files.util.UniversalFileTransferUtility

public class UniversalFileTransferUtility
extends Object

Utility class for doing file transfers on universal systems


Constructor Summary
UniversalFileTransferUtility()
           
 
Method Summary
protected static String checkForCollision(Shell shell, IRemoteFile targetFolder, String oldName)
           
protected static void cleanup(IRemoteFile arc1, File arc2)
           
static IResource compressedCopyRemoteResourceToWorkspace(IRemoteFile directory, IProgressMonitor monitor, Shell shell)
           
static void compressedCopyWorkspaceResourceToRemote(IContainer directory, IRemoteFile newTargetFolder, IProgressMonitor monitor, Shell shell)
           
static IFile copyRemoteFileToWorkspace(IRemoteFile srcFileOrFolder, IProgressMonitor monitor, Shell shell)
          replicates a remote file to the temp files project in the workspace
static Object copyRemoteResourceToWorkspace(IRemoteFile srcFileOrFolder, IProgressMonitor monitor, Shell shell)
          Replicates a remote file or folder to the workspace
static Object copyWorkspaceResourceToRemote(IResource srcFileOrFolder, IRemoteFile targetFolder, IProgressMonitor monitor, Shell shell)
          Perform a copy via drag and drop.
static Object copyWorkspaceResourceToRemote(IResource srcFileOrFolder, IRemoteFile targetFolder, IProgressMonitor monitor, Shell shell, boolean checkForCollisions)
          Perform a copy via drag and drop.
static String getActualHostFor(SubSystem subsystem, String remotePath)
           
protected static String getArchiveExtensionFromProperties()
           
static IResource getTempFileFor(IRemoteFile srcFileOrFolder)
          Returns the corresponding temp file location for a remote file or folder
protected static String getWorkspaceRemotePath(SubSystem subsystem, String remotePath)
           
protected static boolean isRemoteFileMounted(SubSystem subsystem, String remotePath)
           
static void transferProperties(IResource source, IRemoteFile target, IProgressMonitor monitor)
           
static void transferRemoteResource(IRemoteFile srcFileOrFolder, IRemoteFile tgtFolder, IProgressMonitor monitor, Shell shell)
          Transfer a remote file or folder from one remote location to another.
protected static String useLocalSeparator(String virtualPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniversalFileTransferUtility

public UniversalFileTransferUtility()
Method Detail

transferRemoteResource

public static void transferRemoteResource(IRemoteFile srcFileOrFolder,
                                          IRemoteFile tgtFolder,
                                          IProgressMonitor monitor,
                                          Shell shell)
Transfer a remote file or folder from one remote location to another.

Parameters:
srcFileOrFolder - the file or folder to copy
tgtFolder - the folder to copy to
monitor - the progress monitor
shell -

copyRemoteFileToWorkspace

public static IFile copyRemoteFileToWorkspace(IRemoteFile srcFileOrFolder,
                                              IProgressMonitor monitor,
                                              Shell shell)
replicates a remote file to the temp files project in the workspace

Parameters:
srcFileOrFolder - the file to copy
monitor - the progress monitor
shell -
Returns:
the resulting local replica

copyRemoteResourceToWorkspace

public static Object copyRemoteResourceToWorkspace(IRemoteFile srcFileOrFolder,
                                                   IProgressMonitor monitor,
                                                   Shell shell)
Replicates a remote file or folder to the workspace

Parameters:
srcFileOrFolder - the object which is being copied
monitor - a progress monitor
shell -
Returns:
the temporary object that was created after the upload

copyWorkspaceResourceToRemote

public static Object copyWorkspaceResourceToRemote(IResource srcFileOrFolder,
                                                   IRemoteFile targetFolder,
                                                   IProgressMonitor monitor,
                                                   Shell shell)
Perform a copy via drag and drop.

Parameters:
monitor - the progress monitor
shell -
Returns:
an indication whether the operation was successful or not.

copyWorkspaceResourceToRemote

public static Object copyWorkspaceResourceToRemote(IResource srcFileOrFolder,
                                                   IRemoteFile targetFolder,
                                                   IProgressMonitor monitor,
                                                   Shell shell,
                                                   boolean checkForCollisions)
Perform a copy via drag and drop.

Parameters:
monitor - the progress monitor
shell -
Returns:
an indication whether the operation was successful or not.

compressedCopyWorkspaceResourceToRemote

public static void compressedCopyWorkspaceResourceToRemote(IContainer directory,
                                                           IRemoteFile newTargetFolder,
                                                           IProgressMonitor monitor,
                                                           Shell shell)
                                                    throws Exception
Throws:
Exception

transferProperties

public static void transferProperties(IResource source,
                                      IRemoteFile target,
                                      IProgressMonitor monitor)
                               throws CoreException,
                                      RemoteFileSecurityException,
                                      RemoteFileIOException,
                                      SystemMessageException
Throws:
CoreException
RemoteFileSecurityException
RemoteFileIOException
SystemMessageException

getArchiveExtensionFromProperties

protected static String getArchiveExtensionFromProperties()

compressedCopyRemoteResourceToWorkspace

public static IResource compressedCopyRemoteResourceToWorkspace(IRemoteFile directory,
                                                                IProgressMonitor monitor,
                                                                Shell shell)
                                                         throws Exception
Throws:
Exception

cleanup

protected static void cleanup(IRemoteFile arc1,
                              File arc2)
                       throws RemoteFileIOException,
                              RemoteFileSecurityException,
                              RemoteFolderNotEmptyException
Throws:
RemoteFileIOException
RemoteFileSecurityException
RemoteFolderNotEmptyException

useLocalSeparator

protected static String useLocalSeparator(String virtualPath)

getTempFileFor

public static IResource getTempFileFor(IRemoteFile srcFileOrFolder)
Returns the corresponding temp file location for a remote file or folder

Parameters:
srcFileOrFolder - the remote file or folder
Returns:
the local replica location

getActualHostFor

public static String getActualHostFor(SubSystem subsystem,
                                      String remotePath)

isRemoteFileMounted

protected static boolean isRemoteFileMounted(SubSystem subsystem,
                                             String remotePath)

getWorkspaceRemotePath

protected static String getWorkspaceRemotePath(SubSystem subsystem,
                                               String remotePath)

checkForCollision

protected static String checkForCollision(Shell shell,
                                          IRemoteFile targetFolder,
                                          String oldName)

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.