use of org.eclipse.core.resources.IFolder in project tdi-studio-se by Talend.
the class JobScriptsManager method addNodeToResource.
protected void addNodeToResource(IResource[] resources, List<IResource> sourceFile) throws CoreException {
for (IResource resource : resources) {
if (resource instanceof IFolder) {
IFolder folder = (IFolder) resource;
addNodeToResource(folder.members(), sourceFile);
}
if (resource instanceof IFile) {
sourceFile.add(resource);
}
}
}
use of org.eclipse.core.resources.IFolder in project tdi-studio-se by Talend.
the class UserComponentsProviderTest method test_preComponentsLoad_oldComponentsInProject_Zip.
@Test
public void test_preComponentsLoad_oldComponentsInProject_Zip() throws Exception {
File testDataFile = getTestDataFile(PATH_OLD_COMPONENT);
Assert.assertTrue(testDataFile.exists());
final Project currentProject = ProjectManager.getInstance().getCurrentProject();
final IProject project = ResourceUtils.getProject(currentProject);
final IFolder projectComponentsFolder = project.getFolder(ERepositoryObjectType.getFolderName(ERepositoryObjectType.COMPONENTS));
Assert.assertTrue(projectComponentsFolder.exists());
FilesUtils.copyFile(testDataFile, new File(projectComponentsFolder.getLocation().toFile(), testDataFile.getName()));
UserComponentsProviderTestClass provider = new UserComponentsProviderTestClass() {
protected File getExternalComponentsLocation() {
return workFolder;
}
};
provider.preComponentsLoad();
testEmpty(provider);
}
use of org.eclipse.core.resources.IFolder in project tdi-studio-se by Talend.
the class UserComponentsProviderTest method test_preComponentsLoad_oldComponentsInProject_Folder.
@Test
public void test_preComponentsLoad_oldComponentsInProject_Folder() throws Exception {
final String componentName = "tHTMLInput";
File testDataFile = getTestDataFile(PATH_OLD_COMPONENT);
Assert.assertTrue(testDataFile.exists());
final Project currentProject = ProjectManager.getInstance().getCurrentProject();
final IProject project = ResourceUtils.getProject(currentProject);
final IFolder projectComponentsFolder = project.getFolder(ERepositoryObjectType.getFolderName(ERepositoryObjectType.COMPONENTS));
Assert.assertTrue(projectComponentsFolder.exists());
FilesUtils.unzip(testDataFile.getAbsolutePath(), projectComponentsFolder.getLocation().toFile().getAbsolutePath());
UserComponentsProviderTestClass provider = new UserComponentsProviderTestClass() {
protected File getExternalComponentsLocation() {
return workFolder;
}
};
provider.preComponentsLoad();
File installationFolder = provider.getInstallationFolder();
Assert.assertTrue(installationFolder.exists());
Assert.assertEquals(1, installationFolder.list().length);
File compFolder = new File(installationFolder, componentName);
Assert.assertTrue(compFolder.exists());
Assert.assertTrue(new File(compFolder, componentName + "_java.xml").exists());
}
use of org.eclipse.core.resources.IFolder in project tdi-studio-se by Talend.
the class Log4jPrefsSettingManager method isLog4jPrefsExist.
public boolean isLog4jPrefsExist() {
try {
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
IFolder prefSettingFolder = ResourceUtils.getFolder(project, RepositoryConstants.SETTING_DIRECTORY, false);
IFile presLog4jFile = prefSettingFolder.getFile(Log4jPrefsConstants.LOG4J_RESOURCES + Log4jPrefsConstants.LOG4j_PREFS_SUFFIX);
if (presLog4jFile.exists()) {
return true;
}
} catch (PersistenceException e) {
e.printStackTrace();
}
return false;
}
use of org.eclipse.core.resources.IFolder in project tdi-studio-se by Talend.
the class TalendProcessJavaProjectTest method testGetSrcSubFolder.
/**
* Test method for
* {@link org.talend.designer.runprocess.java.TalendProcessJavaProject#getSrcSubFolder(org.eclipse.core.runtime.IProgressMonitor, java.lang.String)}
* .
*/
@Test
public void testGetSrcSubFolder() {
IFolder srcFolder = talendJavaProject.getSrcFolder();
Assert.assertNotNull(srcFolder);
Assert.assertTrue(srcFolder.exists());
IFolder testFolder = talendJavaProject.getSrcSubFolder(null, "test1");
Assert.assertNotNull(srcFolder);
Assert.assertTrue(testFolder.exists());
Assert.assertTrue(testFolder.getLocation().toFile().exists());
Assert.assertEquals("test1", testFolder.getName());
Assert.assertEquals(MavenSystemFolders.JAVA.getPath() + "/test1", testFolder.getProjectRelativePath().toString());
}
Aggregations