diff options
author | cgerking | 2015-08-04 13:26:00 +0000 |
---|---|---|
committer | cgerking | 2015-08-04 13:26:00 +0000 |
commit | b0df200a292d41cb985d15fd3aca79967290eb23 (patch) | |
tree | 3e68bd8be4ee62927360477bcd1bc22a3e79c575 | |
parent | 9e2780772604aff172f7cf32dd8a102c4c8428e3 (diff) | |
download | org.eclipse.qvto-b0df200a292d41cb985d15fd3aca79967290eb23.tar.gz org.eclipse.qvto-b0df200a292d41cb985d15fd3aca79967290eb23.tar.xz org.eclipse.qvto-b0df200a292d41cb985d15fd3aca79967290eb23.zip |
[319076] - Get rid of unused non-API classes
4 files changed, 0 insertions, 271 deletions
diff --git a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/AbstractBundleResource.java b/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/AbstractBundleResource.java deleted file mode 100644 index 444a1c363..000000000 --- a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/AbstractBundleResource.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Borland Software Corporation and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Borland Software Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.m2m.internal.qvt.oml.common.io.eclipse; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.m2m.internal.qvt.oml.common.io.CResource; - - -public abstract class AbstractBundleResource implements CResource { - - protected final IPath resourcePath; - protected final BundleModuleRegistry resourceRegistry; - - protected AbstractBundleResource(IPath path, BundleModuleRegistry bundleRegistry) { - if(path == null || path.isEmpty() || !path.isValidPath(path.toString())) { - throw new IllegalArgumentException("Invalid bundle resource path: " + path); //$NON-NLS-1$ - } - - this.resourcePath = path; - this.resourceRegistry = bundleRegistry; - } - - public String getBundleSymbolicName() { - return resourceRegistry.getBundleSymbolicName(); - } - - protected IPath getPath() { - return resourcePath; - } - - public String getFullPath() { - return resourcePath.toOSString(); - } - - public String getName() { - String name = resourcePath.lastSegment(); - return name != null ? name : ""; //$NON-NLS-1$ - } - - @Override - public String toString() { - return "platform:/plugin/" + resourceRegistry.getBundleSymbolicName() + "/" + resourcePath.toString(); //$NON-NLS-1$ //$NON-NLS-2$ - } - - @Override - public boolean equals(Object another) { - if(another instanceof AbstractBundleResource) { - AbstractBundleResource res = (AbstractBundleResource)another; - return resourcePath.equals(res.resourcePath) && - resourceRegistry.getBundleSymbolicName().equals( - res.resourceRegistry.getBundleSymbolicName()); - } - - return false; - } - - @Override - public int hashCode() { - int result = 17; - result = 37 * result + resourcePath.hashCode(); - result = 37 * result + resourceRegistry.getBundleSymbolicName().hashCode(); - return result; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFile.java b/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFile.java deleted file mode 100644 index 5068d7cec..000000000 --- a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFile.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Borland Software Corporation and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Borland Software Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.m2m.internal.qvt.oml.common.io.eclipse; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Platform; -import org.eclipse.m2m.internal.qvt.oml.common.io.CFile; -import org.eclipse.m2m.internal.qvt.oml.common.io.CFolder; - - -public class BundleFile extends AbstractBundleResource implements CFile { - private URL resourceURL; - private String unitName; - - public BundleFile(IPath resourcePath, BundleModuleRegistry bundleRegistry) { - super(resourcePath, bundleRegistry); - this.resourceURL = Platform.getBundle(bundleRegistry.getBundleSymbolicName()).getResource(resourcePath.toString()); - this.unitName = resourcePath.removeFileExtension().lastSegment(); - } - - - public InputStream getContents() throws IOException { - if(resourceURL != null) { - return resourceURL.openStream(); - } - return new ByteArrayInputStream(new byte[0]); - } - - public String getUnitName() { - return unitName; - } - - public String getCharset() throws IOException { - return ResourcesPlugin.getEncoding(); - } - - public CFolder getParent() { - if(resourcePath.segmentCount() > 1) { - IPath parentPath = resourcePath.removeLastSegments(1); - return new BundleFolder(parentPath, resourceRegistry); - } - return null; - } - - public boolean exists() { - return resourceURL != null; - } -} diff --git a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFolder.java b/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFolder.java deleted file mode 100644 index b90249e65..000000000 --- a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleFolder.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Borland Software Corporation and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Borland Software Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.m2m.internal.qvt.oml.common.io.eclipse; - -import java.util.Collection; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.m2m.internal.qvt.oml.common.io.CFile; -import org.eclipse.m2m.internal.qvt.oml.common.io.CFolder; - - -public class BundleFolder extends AbstractBundleResource implements CFolder { - - public BundleFolder(IPath dirPath, BundleModuleRegistry resourceRegistry) { - super(dirPath, resourceRegistry); - } - - public CFolder getParent() { - if(resourcePath.segmentCount() <= 1) { - return null; - } - return new BundleFolder(resourcePath.removeLastSegments(1), resourceRegistry); - } - - - public CFile getFile(String name) { - Collection<IPath> files = resourceRegistry.getChildFiles(resourcePath); - for (IPath path : files) { - if(name.equals(path.lastSegment())) { - return new BundleFile(path, resourceRegistry); - } - } - return null; - } - - public boolean exists() { - return true; - } - -} diff --git a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleModuleRegistry.java b/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleModuleRegistry.java deleted file mode 100644 index da152e2b8..000000000 --- a/plugins/org.eclipse.m2m.qvt.oml.common/src/org/eclipse/m2m/internal/qvt/oml/common/io/eclipse/BundleModuleRegistry.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2015 Borland Software Corporation and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Borland Software Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.m2m.internal.qvt.oml.common.io.eclipse; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.IPath; - -public class BundleModuleRegistry { - private final Set<IPath> filePaths; - private final Set<IPath> folderPaths; - private final Set<IPath> defaultFolderItems; - private final String bundleID; - - public BundleModuleRegistry(String bundleSymbolicName, Collection<IPath> paths) { - if(bundleSymbolicName == null || bundleSymbolicName.length() == 0) { - throw new IllegalArgumentException("Invalid bundle symbolic name"); //$NON-NLS-1$ - } - - for (IPath nextPath : paths) { - if(nextPath == null || nextPath.isEmpty() || !nextPath.isValidPath(nextPath.toString())) { - throw new IllegalArgumentException("Invalid resource path:" + nextPath); //$NON-NLS-1$ - } - } - - bundleID = bundleSymbolicName; - defaultFolderItems = new HashSet<IPath>(); - filePaths = new HashSet<IPath>(); - folderPaths = new HashSet<IPath>(); - - for(IPath filePath : paths) { - if(filePath.segmentCount() > 1) { - extractFolderPaths(folderPaths, filePath); - filePaths.add(filePath); - } else { - defaultFolderItems.add(filePath); - } - } - } - - public String getBundleSymbolicName() { - return bundleID; - } - - public boolean fileExists(IPath filePath) { - return defaultFolderItems.contains(filePath) || filePaths.contains(filePath); - } - - public Collection<IPath> getChildFiles(IPath parentPath) { - Collection<IPath> children = new ArrayList<IPath>(); - for (IPath file : filePaths) { - if(parentPath.isPrefixOf(file)) { - if(file.segmentCount() - 1 == parentPath.segmentCount()) { - children.add(file); - } - } - } - return children; - } - - @Override - public String toString() { - return getClass().getSimpleName() + " : ID = " + bundleID; //$NON-NLS-1$ - } - - private static void extractFolderPaths(Set<IPath> paths, IPath filePath) { - if(filePath.segmentCount() == 1) { - return; - } - IPath parent = filePath.removeLastSegments(1); - paths.add(parent); - extractFolderPaths(paths, parent); - } -}
\ No newline at end of file |