1 package compbio.engine.archive;
3 import java.io.FileOutputStream;
4 import java.io.IOException;
5 import java.net.MalformedURLException;
7 import java.nio.channels.Channels;
8 import java.nio.channels.ReadableByteChannel;
9 import java.nio.file.Paths;
10 import java.nio.file.Files;
11 import java.util.List;
13 public class ArchivedJob {
19 public ArchivedJob(String id) {
23 public boolean copyArchiveFromWeb(String webpath) throws IOException, MalformedURLException {
24 URL website = new URL(webpath);
25 ReadableByteChannel rbc = Channels.newChannel(website.openStream());
26 FileOutputStream fos = new FileOutputStream(path);
27 fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
31 public boolean copyArchiveLocaly(String localpath) throws IOException {
32 Files.copy(Paths.get(localpath), Paths.get(path));
36 public void setArchivePath(String path) {
40 public int getSize() {
44 public List<String> unpack() {