Package org.eclipse.core.filesystem

Examples of org.eclipse.core.filesystem.IFileStore.fetchInfo()


  protected IFileStore createDirectory(String path) throws CoreException {
    IFileInfo info = null;
    URI location = makeLocalPathAbsolute(path);
    IFileStore dir = EFS.getStore(location);
    dir.mkdir(EFS.NONE, null);
    info = dir.fetchInfo();
    assertTrue("Coudn't create directory " + path, info.exists() && info.isDirectory());

    return dir;
  }
View Full Code Here


  protected static IFileStore createFile(URI uri, String fileContent) throws CoreException {
    IFileStore outputFile = EFS.getStore(uri);
    outputFile.delete(EFS.NONE, null);
    InputStream input = new ByteArrayInputStream(fileContent.getBytes());
    transferData(input, outputFile.openOutputStream(EFS.NONE, null));
    IFileInfo info = outputFile.fetchInfo();
    assertTrue("Coudn't create file " + uri, info.exists() && !info.isDirectory());

    return outputFile;
  }
View Full Code Here

    // create an empty organizational folder
    IFileStore rootLocation = OrionConfiguration.getRootLocation();
    String orgFolderName = "zz";
    IFileStore orgFolder = rootLocation.getChild(orgFolderName);
    assertFalse(orgFolder.fetchInfo().exists());
    orgFolder.mkdir(EFS.NONE, null);
    assertTrue(orgFolder.fetchInfo().exists());
    assertTrue(orgFolder.fetchInfo().isDirectory());

    // read all the users which will trigger the archive
View Full Code Here

    IFileStore rootLocation = OrionConfiguration.getRootLocation();
    String orgFolderName = "zz";
    IFileStore orgFolder = rootLocation.getChild(orgFolderName);
    assertFalse(orgFolder.fetchInfo().exists());
    orgFolder.mkdir(EFS.NONE, null);
    assertTrue(orgFolder.fetchInfo().exists());
    assertTrue(orgFolder.fetchInfo().isDirectory());

    // read all the users which will trigger the archive
    List<String> users = metaStore.readAllUsers();
    assertNotNull(users);
View Full Code Here

    String orgFolderName = "zz";
    IFileStore orgFolder = rootLocation.getChild(orgFolderName);
    assertFalse(orgFolder.fetchInfo().exists());
    orgFolder.mkdir(EFS.NONE, null);
    assertTrue(orgFolder.fetchInfo().exists());
    assertTrue(orgFolder.fetchInfo().isDirectory());

    // read all the users which will trigger the archive
    List<String> users = metaStore.readAllUsers();
    assertNotNull(users);
View Full Code Here

    List<String> users = metaStore.readAllUsers();
    assertNotNull(users);

    // verify the invalid metadata folder has moved to the archive
    IFileStore archiveFolder = rootLocation.getChild(SimpleMetaStoreUtil.ARCHIVE);
    assertTrue(archiveFolder.fetchInfo().exists());
    assertTrue(archiveFolder.fetchInfo().isDirectory());
    IFileStore archivedOrgFolder = archiveFolder.getChild(orgFolderName);
    assertTrue(archivedOrgFolder.fetchInfo().exists());
    assertTrue(archivedOrgFolder.fetchInfo().isDirectory());
    assertFalse(orgFolder.fetchInfo().exists());
View Full Code Here

    assertNotNull(users);

    // verify the invalid metadata folder has moved to the archive
    IFileStore archiveFolder = rootLocation.getChild(SimpleMetaStoreUtil.ARCHIVE);
    assertTrue(archiveFolder.fetchInfo().exists());
    assertTrue(archiveFolder.fetchInfo().isDirectory());
    IFileStore archivedOrgFolder = archiveFolder.getChild(orgFolderName);
    assertTrue(archivedOrgFolder.fetchInfo().exists());
    assertTrue(archivedOrgFolder.fetchInfo().isDirectory());
    assertFalse(orgFolder.fetchInfo().exists());
  }
View Full Code Here

    // verify the invalid metadata folder has moved to the archive
    IFileStore archiveFolder = rootLocation.getChild(SimpleMetaStoreUtil.ARCHIVE);
    assertTrue(archiveFolder.fetchInfo().exists());
    assertTrue(archiveFolder.fetchInfo().isDirectory());
    IFileStore archivedOrgFolder = archiveFolder.getChild(orgFolderName);
    assertTrue(archivedOrgFolder.fetchInfo().exists());
    assertTrue(archivedOrgFolder.fetchInfo().isDirectory());
    assertFalse(orgFolder.fetchInfo().exists());
  }

  @Test
View Full Code Here

    IFileStore archiveFolder = rootLocation.getChild(SimpleMetaStoreUtil.ARCHIVE);
    assertTrue(archiveFolder.fetchInfo().exists());
    assertTrue(archiveFolder.fetchInfo().isDirectory());
    IFileStore archivedOrgFolder = archiveFolder.getChild(orgFolderName);
    assertTrue(archivedOrgFolder.fetchInfo().exists());
    assertTrue(archivedOrgFolder.fetchInfo().isDirectory());
    assertFalse(orgFolder.fetchInfo().exists());
  }

  @Test
  public void testArchiveInvalidMetaDataFileInOrganizationalFolder() throws CoreException {
View Full Code Here

    // create a invalid metadata file
    IFileStore rootLocation = OrionConfiguration.getRootLocation();
    String orgFolderName = "te";
    IFileStore orgFolder = rootLocation.getChild(orgFolderName);
    assertTrue(orgFolder.fetchInfo().exists());
    assertTrue(orgFolder.fetchInfo().isDirectory());
    String invalid = "delete.html";
    IFileStore invalidFileInOrg = orgFolder.getChild(invalid);
    try {
      OutputStream outputStream = invalidFileInOrg.openOutputStream(EFS.NONE, null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.