Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6865c43c8cd1dc108ce2976b3808c73403c6e042 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
 * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Wind River Systems - initial API and implementation
 * Martin Oberhuber (Wind River) - [238564] Adopt TM 3.0 APIs
 ******************************************************************************/
package org.eclipse.tcf.internal.rse.files;

import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.AbstractRemoteFile;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;

public class TCFFileAdapter implements IHostFileToRemoteFileAdapter {

    public AbstractRemoteFile convertToRemoteFile(FileServiceSubSystem ss,
            IRemoteFileContext ctx, IRemoteFile parent, IHostFile node) {
        return new TCFRemoteFile(ss, ctx, parent, node);
    }

    public AbstractRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss,
            IRemoteFileContext ctx, IRemoteFile parent, IHostFile[] nodes) {
        if (nodes == null) return null;
        TCFRemoteFile[] res = new TCFRemoteFile[nodes.length];
        for (int i = 0; i < res.length; i++) {
            res[i] = new TCFRemoteFile(ss, ctx, parent, nodes[i]);
        }
        return res;
    }
}

Back to the top