Removing VirtualFile.asRemotable in favor of toExternalURL.

This commit is contained in:
Jesse Glick committed 2018-04-02 15:55:40 -04:00
1 parent a345051046
commit 547fd6fe6e
2 files changed
+26 -25

No files matched your search

+23
View File
@@ -139,6 +139,7 @@ import static hudson.Util.isSymlink;
import java.util.Collections;
import org.apache.tools.ant.BuildException;
import org.kohsuke.accmod.restrictions.Beta;
/**
* {@link File} like object with remoting support.
@@ -903,6 +904,28 @@ public final class FilePath implements Serializable {
}
}
/**
* Copies the content of a URL to a remote file.
* Unlike {@link #copyFrom} this will not transfer content over a Remoting channel.
* @since FIXME
*/
@Restricted(Beta.class)
public void copyFromRemotely(URL url) throws IOException, InterruptedException {
act(new CopyFromRemotely(url));
}
private final class CopyFromRemotely extends MasterToSlaveFileCallable<Void> {
private static final long serialVersionUID = 1;
private final URL url;
CopyFromRemotely(URL url) {
this.url = url;
}
@Override
public Void invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
copyFrom(url);
return null;
}
}
/**
* Replaces the content of this file by the data from the given {@link InputStream}.
*