- * Copies the trace specific supplementary folder to the new trace name.
- *
- * @param newTraceName The new trace name
- */
- public void copySupplementaryFolder(String newTraceName) {
- IFolder oldSupplFolder = getTraceSupplementaryFolder(fResource.getName());
- IFolder newSupplFolder = getTraceSupplementaryFolder(newTraceName);
-
- // copy supplementary folder
- if (oldSupplFolder.exists()) {
- try {
- oldSupplFolder.copy(newSupplFolder.getFullPath(), true, new NullProgressMonitor());
- } catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Copies the trace specific supplementary folder a new folder.
- *
- * @param destination The destination folder to copy to.
- */
- public void copySupplementaryFolder(IFolder destination) {
- IFolder oldSupplFolder = getTraceSupplementaryFolder(fResource.getName());
-
- // copy supplementary folder
- if (oldSupplFolder.exists()) {
- try {
- oldSupplFolder.copy(destination.getFullPath(), true, new NullProgressMonitor());
- } catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
- }
- }
- }
-
-
- /**
- * Refreshes the trace specific supplementary folder information. It creates the folder if not exists.
- * It sets the persistence property of the trace resource
- */
- public void refreshSupplementaryFolder() {
- createSupplementaryDirectory();
- }
-
- /**
- * Checks if supplementary resource exist or not.
- *
- * @return <code>true</code> if one or more files are under the trace supplementary folder
- */
- public boolean hasSupplementaryResources() {
- IResource[] resources = getSupplementaryResources();
- return (resources.length > 0);
- }
-
- /**
- * Returns the supplementary resources under the trace supplementary folder.
- *
- * @return array of resources under the trace supplementary folder.
- */
- public IResource[] getSupplementaryResources() {
- IFolder supplFolder = getTraceSupplementaryFolder(fResource.getName());
- if (supplFolder.exists()) {
- try {
- return supplFolder.members();
- } catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); //$NON-NLS-1$
- }
- }
- return new IResource[0];
- }
-
- /**
- * Deletes the given resources.
- *
- * @param resources array of resources to delete.