Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-08 19:17:38 +0000
committerThomas Watson2019-05-16 14:07:43 +0000
commit3b63527921acfe7c78cce6b84ab8e869ef17f230 (patch)
treed92a825232ce414f139b4ec862e628b1b57c35ca /bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage
parent06d5ba9879305c04d1d7e5076d67a38af2ef3a66 (diff)
downloadrt.equinox.framework-3b63527921acfe7c78cce6b84ab8e869ef17f230.tar.gz
rt.equinox.framework-3b63527921acfe7c78cce6b84ab8e869ef17f230.tar.xz
rt.equinox.framework-3b63527921acfe7c78cce6b84ab8e869ef17f230.zip
Change-Id: I4ef764e744192dc3564ad053e8984e891aadfe44 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java9
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java12
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java7
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java4
21 files changed, 97 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java
index 77155fdcc..28950e758 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java
@@ -36,6 +36,7 @@ public class BundleLocalizationImpl implements BundleLocalization {
* @return A <code>ResourceBundle</code> object for the given bundle and locale.
* If null is passed for the locale parameter, the default locale is used.
*/
+ @Override
public ResourceBundle getLocalization(Bundle bundle, String locale) {
Module m = ((EquinoxBundle) bundle).getModule();
ModuleRevision r = m.getCurrentRevision();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java
index 324fc43fa..cf49f7e95 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java
@@ -230,14 +230,17 @@ public class ManifestLocalization {
super(in);
}
+ @Override
public void setParent(ResourceBundle parent) {
super.setParent(parent);
}
+ @Override
public boolean isEmpty() {
return false;
}
+ @Override
public boolean isStemEmpty() {
return parent == null;
}
@@ -252,24 +255,29 @@ public class ManifestLocalization {
}
@SuppressWarnings("unchecked")
+ @Override
public Enumeration<String> getKeys() {
return Collections.enumeration(Collections.EMPTY_LIST);
}
+ @Override
protected Object handleGetObject(String arg0) throws MissingResourceException {
return null;
}
+ @Override
public void setParent(ResourceBundle parent) {
super.setParent(parent);
}
+ @Override
public boolean isEmpty() {
if (parent == null)
return true;
return ((BundleResourceBundle) parent).isEmpty();
}
+ @Override
public boolean isStemEmpty() {
if (defaultRoot.equals(localeString))
return false;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index ddea8b6f5..9f30acd13 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -555,6 +555,7 @@ public class Storage {
/**
* @throws IOException
*/
+ @Override
public void connect() throws IOException {
connected = true;
}
@@ -562,6 +563,7 @@ public class Storage {
/**
* @throws IOException
*/
+ @Override
public InputStream getInputStream() throws IOException {
return (in);
}
@@ -580,6 +582,7 @@ public class Storage {
if (System.getSecurityManager() == null)
return getUpdateLocation0(module);
return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ @Override
public String run() {
return getUpdateLocation0(module);
}
@@ -922,6 +925,7 @@ public class Storage {
return getContentFile0(staged, isReference, bundleID, generationID);
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() {
+ @Override
public File run() throws BundleException {
return getContentFile0(staged, isReference, bundleID, generationID);
}
@@ -1030,6 +1034,7 @@ public class Storage {
return stageContent0(in, sourceURL);
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() {
+ @Override
public File run() throws BundleException {
return stageContent0(in, sourceURL);
}
@@ -1186,6 +1191,7 @@ public class Storage {
} else {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws IOException {
delete0(delete);
return null;
@@ -1216,6 +1222,7 @@ public class Storage {
} else {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() throws IOException {
save0();
return null;
@@ -1859,6 +1866,7 @@ public class Storage {
private int curDataIndex = 0;
private URL nextElement = null;
+ @Override
public boolean hasMoreElements() {
if (nextElement != null)
return true;
@@ -1866,6 +1874,7 @@ public class Storage {
return nextElement != null;
}
+ @Override
public URL nextElement() {
if (!hasMoreElements())
throw new NoSuchElementException();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
index 312f6f6c2..c959047c9 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
@@ -39,26 +39,32 @@ public class SystemBundleFile extends BundleFile {
if (BundleInfo.OSGI_BUNDLE_MANIFEST.equals(path)) {
return new BundleEntry() {
+ @Override
public InputStream getInputStream() throws IOException {
return getManifestURL().openStream();
}
+ @Override
public long getSize() {
return 0;
}
+ @Override
public String getName() {
return BundleInfo.OSGI_BUNDLE_MANIFEST;
}
+ @Override
public long getTime() {
return 0;
}
+ @Override
public URL getLocalURL() {
return getManifestURL();
}
+ @Override
public URL getFileURL() {
return null;
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java
index 0fa694a40..81ccd3165 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java
@@ -79,6 +79,7 @@ public abstract class BundleEntry {
*
* @return String representation of this BundleEntry.
*/
+ @Override
public String toString() {
return (getName());
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java
index eb41c5588..6fba2d6c4 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java
@@ -177,6 +177,7 @@ abstract public class BundleFile {
return mruIndex;
}
+ @Override
public String toString() {
return String.valueOf(basefile);
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java
index cfa886448..366c82b47 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java
@@ -48,6 +48,7 @@ public class DirBundleFile extends BundleFile {
return enableStrictBundleEntryPath ? secureAction.getCanonicalFile(basefile) : basefile;
}
+ @Override
public File getFile(String path, boolean nativeCode) {
final boolean checkInBundle = path != null && path.indexOf(POINTER_UPPER_DIRECTORY) >= 0;
File file = new File(this.basefile, path);
@@ -105,6 +106,7 @@ public class DirBundleFile extends BundleFile {
return file;
}
+ @Override
public BundleEntry getEntry(String path) {
File filePath = getFile(path, false);
if (filePath == null)
@@ -112,11 +114,13 @@ public class DirBundleFile extends BundleFile {
return new FileBundleEntry(filePath, path);
}
+ @Override
public boolean containsDir(String dir) {
File dirPath = getFile(dir, false);
return dirPath != null && BundleFile.secureAction.isDirectory(dirPath);
}
+ @Override
public Enumeration<String> getEntryPaths(String path, boolean recurse) {
if (path.length() > 0 && path.charAt(0) == '/')
path = path.substring(1);
@@ -145,10 +149,12 @@ public class DirBundleFile extends BundleFile {
return Collections.enumeration(entries);
}
+ @Override
public void close() {
// nothing to do.
}
+ @Override
public void open() {
// nothing to do.
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java
index b0d4e9872..8e6237967 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java
@@ -42,23 +42,28 @@ public class DirZipBundleEntry extends BundleEntry {
/**
* @throws IOException
*/
+ @Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(new byte[0]);
}
+ @Override
public long getSize() {
return 0;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public long getTime() {
return 0;
}
@SuppressWarnings("deprecation")
+ @Override
public URL getLocalURL() {
try {
return new URL("jar:" + bundleFile.basefile.toURL() + "!/" + name); //$NON-NLS-1$ //$NON-NLS-2$
@@ -69,6 +74,7 @@ public class DirZipBundleEntry extends BundleEntry {
}
@SuppressWarnings("deprecation")
+ @Override
public URL getFileURL() {
try {
return bundleFile.extractDirectory(name).toURL();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java
index f1a72623b..77d605bce 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java
@@ -54,6 +54,7 @@ public class FileBundleEntry extends BundleEntry {
* @return InputStream for the entry
* @exception java.io.IOException
*/
+ @Override
public InputStream getInputStream() throws IOException {
return BundleFile.secureAction.getFileInputStream(file);
}
@@ -63,6 +64,7 @@ public class FileBundleEntry extends BundleEntry {
*
* @return size of entry
*/
+ @Override
public long getSize() {
return BundleFile.secureAction.length(file);
}
@@ -72,6 +74,7 @@ public class FileBundleEntry extends BundleEntry {
*
* @return name of entry
*/
+ @Override
public String getName() {
return (name);
}
@@ -83,15 +86,18 @@ public class FileBundleEntry extends BundleEntry {
*
* @return last modification time.
*/
+ @Override
public long getTime() {
return BundleFile.secureAction.lastModified(file);
}
+ @Override
public URL getLocalURL() {
return getFileURL();
}
@SuppressWarnings("deprecation")
+ @Override
public URL getFileURL() {
try {
return file.toURL();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
index c8253481a..e6d8caf09 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
@@ -181,6 +181,7 @@ public class MRUBundleFileList implements EventDispatcher<Object, Object, Bundle
useStampList[index] = ++curUseStamp;
}
+ @Override
public final void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, BundleFile eventObject) {
if (firstDispatch) {
// used to work around bug 275166; we don't want to leak the TCCL in this thread.
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
index 67051edbf..4d8fc7c68 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
@@ -61,6 +61,7 @@ public class NestedDirBundleFile extends BundleFile {
this.filterPrefixes = filterPrefixes;
}
+ @Override
public void close() {
// do nothing.
}
@@ -86,6 +87,7 @@ public class NestedDirBundleFile extends BundleFile {
return filterPath(path);
}
+ @Override
public BundleEntry getEntry(String path) {
if (filterPath(path)) {
return null;
@@ -93,6 +95,7 @@ public class NestedDirBundleFile extends BundleFile {
return baseBundleFile.getEntry(prependNestedDir(path));
}
+ @Override
public boolean containsDir(String dir) {
if (dir == null)
return false;
@@ -108,6 +111,7 @@ public class NestedDirBundleFile extends BundleFile {
return new StringBuffer(nestedDirName).append(path).toString();
}
+ @Override
public Enumeration<String> getEntryPaths(String path, boolean recurse) {
if (filterDir(path)) {
return null;
@@ -118,10 +122,12 @@ public class NestedDirBundleFile extends BundleFile {
return null;
return new Enumeration<String>() {
+ @Override
public boolean hasMoreElements() {
return basePaths.hasMoreElements();
}
+ @Override
public String nextElement() {
String next = basePaths.nextElement();
return next.substring(cpLength);
@@ -129,6 +135,7 @@ public class NestedDirBundleFile extends BundleFile {
};
}
+ @Override
public File getFile(String entry, boolean nativeCode) {
// getFile is only valid if this is a root bundle file.
// TODO to catch bugs we probably should throw new UnsupportedOperationException()
@@ -138,6 +145,7 @@ public class NestedDirBundleFile extends BundleFile {
/**
* @throws IOException
*/
+ @Override
public void open() throws IOException {
// do nothing
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java
index 187874578..8dba5fdfc 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java
@@ -52,6 +52,7 @@ public class ZipBundleEntry extends BundleEntry {
* @return InputStream for the entry
* @exception java.io.IOException
*/
+ @Override
public InputStream getInputStream() throws IOException {
return bundleFile.getInputStream(zipEntry);
}
@@ -61,6 +62,7 @@ public class ZipBundleEntry extends BundleEntry {
*
* @return size of entry
*/
+ @Override
public long getSize() {
return zipEntry.getSize();
}
@@ -70,6 +72,7 @@ public class ZipBundleEntry extends BundleEntry {
*
* @return name of entry
*/
+ @Override
public String getName() {
return zipEntry.getName();
}
@@ -81,11 +84,13 @@ public class ZipBundleEntry extends BundleEntry {
*
* @return last modification time.
*/
+ @Override
public long getTime() {
return zipEntry.getTime();
}
@SuppressWarnings("deprecation")
+ @Override
public URL getLocalURL() {
try {
return new URL("jar:" + bundleFile.basefile.toURL() + "!/" + zipEntry.getName()); //$NON-NLS-1$//$NON-NLS-2$
@@ -96,6 +101,7 @@ public class ZipBundleEntry extends BundleEntry {
}
@SuppressWarnings("deprecation")
+ @Override
public URL getFileURL() {
try {
File file = bundleFile.getFile(zipEntry.getName(), false);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
index b80ed90ef..c1cb4d84d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
@@ -197,6 +197,7 @@ public class ZipBundleFile extends BundleFile {
return generation.getExtractFile(".cp", entryName); //$NON-NLS-1$
}
+ @Override
public File getFile(String entry, boolean nativeCode) {
if (!lockOpen()) {
return null;
@@ -246,6 +247,7 @@ public class ZipBundleFile extends BundleFile {
return null;
}
+ @Override
public boolean containsDir(String dir) {
if (!lockOpen()) {
return false;
@@ -282,6 +284,7 @@ public class ZipBundleFile extends BundleFile {
return false;
}
+ @Override
public BundleEntry getEntry(String path) {
if (!lockOpen()) {
return null;
@@ -356,6 +359,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public void close() throws IOException {
openLock.lock();
try {
@@ -418,6 +422,7 @@ public class ZipBundleFile extends BundleFile {
return false;
}
+ @Override
public void open() throws IOException {
getZipFile(false);
}
@@ -467,6 +472,7 @@ public class ZipBundleFile extends BundleFile {
incrementReference();
}
+ @Override
public int available() throws IOException {
try {
return super.available();
@@ -475,6 +481,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public void close() throws IOException {
try {
super.close();
@@ -490,6 +497,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public int read() throws IOException {
try {
return super.read();
@@ -498,6 +506,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public int read(byte[] var0, int var1, int var2) throws IOException {
try {
return super.read(var0, var1, var2);
@@ -506,6 +515,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public int read(byte[] var0) throws IOException {
try {
return super.read(var0);
@@ -514,6 +524,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public void reset() throws IOException {
try {
super.reset();
@@ -522,6 +533,7 @@ public class ZipBundleFile extends BundleFile {
}
}
+ @Override
public long skip(long var0) throws IOException {
try {
return super.skip(var0);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
index f33a490a9..b0ada55f0 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java
@@ -48,6 +48,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
/**
* Parse reference URL.
*/
+ @Override
protected void parseURL(URL url, String str, int start, int end) {
if (end < start)
return;
@@ -145,6 +146,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
*
* @exception IOException thrown if an IO error occurs during connection establishment
*/
+ @Override
protected URLConnection openConnection(URL url) throws IOException {
if (bundleEntry != null) // if the bundleEntry is not null then return quick
return (new BundleURLConnection(url, bundleEntry));
@@ -189,6 +191,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
* @param url the URL.
* @return a string representation of the URL.
*/
+ @Override
protected String toExternalForm(URL url) {
StringBuffer result = new StringBuffer(url.getProtocol());
result.append("://"); //$NON-NLS-1$
@@ -216,6 +219,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
return (result.toString());
}
+ @Override
protected int hashCode(URL url) {
int hash = 0;
String protocol = url.getProtocol();
@@ -236,14 +240,17 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
return hash;
}
+ @Override
protected boolean equals(URL url1, URL url2) {
return sameFile(url1, url2);
}
+ @Override
protected synchronized InetAddress getHostAddress(URL url) {
return null;
}
+ @Override
protected boolean hostsEqual(URL url1, URL url2) {
String host1 = url1.getHost();
String host2 = url2.getHost();
@@ -252,6 +259,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler {
return (host1 == null && host2 == null);
}
+ @Override
protected boolean sameFile(URL url1, URL url2) {
// do a hashcode test to allow each handler to check the adaptor first
if (url1.hashCode() != url2.hashCode())
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java
index e79a6f8b8..4b92876b7 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java
@@ -50,6 +50,7 @@ public class BundleURLConnection extends URLConnection {
this.contentType = null;
}
+ @Override
public synchronized void connect() throws IOException {
if (!connected) {
if (bundleEntry != null) {
@@ -61,10 +62,12 @@ public class BundleURLConnection extends URLConnection {
}
}
+ @Override
public int getContentLength() {
return ((int) bundleEntry.getSize());
}
+ @Override
public String getContentType() {
if (contentType == null) {
contentType = guessContentTypeFromName(bundleEntry.getName());
@@ -89,14 +92,17 @@ public class BundleURLConnection extends URLConnection {
return (contentType);
}
+ @Override
public boolean getDoInput() {
return (true);
}
+ @Override
public boolean getDoOutput() {
return (false);
}
+ @Override
public InputStream getInputStream() throws IOException {
if (!connected) {
connect();
@@ -105,6 +111,7 @@ public class BundleURLConnection extends URLConnection {
return (in);
}
+ @Override
public long getLastModified() {
long lastModified = bundleEntry.getTime();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java
index 2313ecf92..2e4afbc11 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java
@@ -31,6 +31,7 @@ public class BundleURLConverter implements URLConverter {
/* (non-Javadoc)
* @see org.eclipse.osgi.service.urlconversion.URLConverter#toFileURL(java.net.URL)
*/
+ @Override
public URL toFileURL(URL url) throws IOException {
URLConnection connection = url.openConnection();
if (connection instanceof BundleURLConnection) {
@@ -49,6 +50,7 @@ public class BundleURLConverter implements URLConverter {
/* (non-Javadoc)
* @see org.eclipse.osgi.service.urlconversion.URLConverter#resolve(java.net.URL)
*/
+ @Override
public URL resolve(URL url) throws IOException {
URLConnection connection = url.openConnection();
if (connection instanceof BundleURLConnection)
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java
index 328b7e397..3e9523290 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java
@@ -35,6 +35,7 @@ public class Handler extends BundleResourceHandler {
super(container, bundleEntry);
}
+ @Override
protected BundleEntry findBundleEntry(URL url, Module module) throws IOException {
ModuleRevision revision = module.getCurrentRevision();
BundleInfo.Generation revisionInfo = (BundleInfo.Generation) revision.getRevisionInfo();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java
index 0de5a821e..796d10fe1 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java
@@ -35,6 +35,7 @@ public class Handler extends BundleResourceHandler {
super(container, bundleEntry);
}
+ @Override
protected BundleEntry findBundleEntry(URL url, Module module) throws IOException {
ModuleRevision current = module.getCurrentRevision();
ModuleWiring wiring = current == null ? null : current.getWiring();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java
index de85c64c8..a6b1c4f66 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java
@@ -46,10 +46,12 @@ public class Handler extends URLStreamHandler {
/**
* @throws IOException
*/
+ @Override
protected URLConnection openConnection(URL url) throws IOException {
return new ReferenceURLConnection(url, installPath);
}
+ @Override
protected void parseURL(URL url, String str, int start, int end) {
if (end < start) {
return;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java
index 1e12a6106..b9ff45f04 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java
@@ -31,6 +31,7 @@ public class ReferenceInputStream extends InputStream {
/* This method should not be called.
*/
+ @Override
public int read() throws IOException {
throw new IOException();
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java
index d219c6017..80041aa15 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java
@@ -39,6 +39,7 @@ public class ReferenceURLConnection extends URLConnection {
this.installPath = installPath;
}
+ @Override
public synchronized void connect() throws IOException {
if (!connected) {
// TODO assumes that reference URLs are always based on file: URLs.
@@ -91,14 +92,17 @@ public class ReferenceURLConnection extends URLConnection {
}
}
+ @Override
public boolean getDoInput() {
return true;
}
+ @Override
public boolean getDoOutput() {
return false;
}
+ @Override
public InputStream getInputStream() throws IOException {
if (!connected) {
connect();

Back to the top