Example usage for org.apache.commons.vfs2 FileSystemManager setLogger

List of usage examples for org.apache.commons.vfs2 FileSystemManager setLogger

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileSystemManager setLogger.

Prototype

void setLogger(Log log);

Source Link

Document

Sets the logger to use.

Usage

From source file:org.cloudifysource.esc.installer.filetransfer.VfsFileTransfer.java

@Override
public void initialize(final InstallationDetails details, final long endTimeMillis)
        throws TimeoutException, InstallerException {
    this.installerConfiguration = details.getInstallerConfiguration();
    this.deleteRemoteDirectoryContents = details.isDeleteRemoteDirectoryContents();
    if (details.isConnectedToPrivateIp()) {
        host = details.getPrivateIp();//  w ww .ja  v a2  s.  c o m
    } else {
        host = details.getPublicIp();
    }

    checkTimeout(endTimeMillis);

    initVFSManager(details, endTimeMillis);

    createTargetURI(details);

    final FileSystemManager mng = fileSystemManager;

    mng.setLogger(org.apache.commons.logging.LogFactory.getLog(logger.getName()));

    // when bootstrapping a management machine, pass all of the cloud
    // configuration, including all template
    // for an agent machine, just pass the upload dir fot the specific
    // template.
    String localDirPath = details.getLocalDir();
    if (details.isManagement()) {
        if (details.getCloudFile() == null) {
            throw new IllegalArgumentException("While bootstrapping a management machine, cloud file is null");
        }

        localDirPath = details.getCloudFile().getParentFile().getAbsolutePath();

    }

    try {
        localDir = mng.resolveFile("file:" + localDirPath);
        remoteDir = resolveTargetDirectory(opts, targetURI, mng);

    } catch (final FileSystemException e) {
        throw new InstallerException("Failed to set up file transfer: " + e.getMessage(), e);
    }

}