예제 #1
0
  @Before
  public void setUp() throws FileSystemException {

    fsLocal = new DefaultOpalFileSystem("res:opal-file-system");
    fsLocalRoot = fsLocal.getRoot();

    // MockFtpServer blocks the execution of this test under the unix environment, so this test
    // will be run on Windows until we find a solution...
    if (runningOsIsWindows()) {

      mockFtpServer = new FakeFtpServer();
      mockFtpServer.addUserAccount(new UserAccount("user", "password", "c:/"));

      FileSystem fileSystem = new WindowsFakeFileSystem();
      fileSystem.add(new DirectoryEntry("c:/temp"));
      fileSystem.add(new FileEntry("c:/temp/file1.txt"));
      fileSystem.add(new FileEntry("c:/temp/file2.txt", "this is the file content"));
      mockFtpServer.setFileSystem(fileSystem);

      mockFtpServer.start();

      fsFtp = new DefaultOpalFileSystem("ftp://*****:*****@localhost:21");
      fsFtpRoot = fsFtp.getRoot();
    }
  }
예제 #2
0
 @Test
 public void testLocalFile() throws FileSystemException {
   log.info("file: {}", fsLocal.getRoot().resolveFile("temp.pem"));
   assertThat(fsLocal.getLocalFile(fsLocalRoot.resolveFile("temp.pem"))).isNotNull();
 }