Java 类org.openqa.selenium.io.Zip 实例源码

项目:grid-refactor-remote-server    文件:UploadFile.java   
@Override
public String call() throws Exception {
  TemporaryFilesystem tempfs = getSession().getTemporaryFileSystem();
  File tempDir = tempfs.createTempDir("upload", "file");

  new Zip().unzip(file, tempDir);
  // Select the first file
  File[] allFiles = tempDir.listFiles();
  if (allFiles == null || allFiles.length != 1) {
    throw new WebDriverException("Expected there to be only 1 file. There were: " +
        allFiles.length);
  }

  return allFiles[0].getAbsolutePath();
}