You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2014/04/01 11:04:37 UTC
svn commit: r1583578 - in /db/derby/code/trunk/java:
engine/org/apache/derby/impl/io/ engine/org/apache/derby/impl/io/vfmem/
engine/org/apache/derby/io/
testing/org/apache/derbyTesting/functionTests/util/corruptio/
Author: kahatlen
Date: Tue Apr 1 09:04:37 2014
New Revision: 1583578
URL: http://svn.apache.org/r1583578
Log:
DERBY-6534: Remove StorageFile.getURL() and its implementations
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/io/CPFile.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/io/JarDBFile.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java
db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/CPFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/CPFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/CPFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/CPFile.java Tue Apr 1 09:04:37 2014
@@ -122,15 +122,12 @@ class CPFile extends InputStreamFile
/**
* Return a URL for this file (resource).
- *
- * @see org.apache.derby.io.StorageFile#getURL()
*/
- public URL getURL() {
+ private URL getURL() {
ClassLoader cl = getContextClassLoader(Thread.currentThread());
- URL myURL;
if (cl != null) {
- myURL = getResource(cl, path);
+ URL myURL = getResource(cl, path);
if (myURL != null)
return myURL;
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java Tue Apr 1 09:04:37 2014
@@ -34,8 +34,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.io.RandomAccessFile;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
@@ -438,14 +436,6 @@ class DirFile extends File implements St
return delete();
} // end of deleteAll
- /**
- * @see org.apache.derby.io.StorageFile#getURL()
- */
- public URL getURL() throws MalformedURLException {
-
- return toURI().toURL();
- }
-
public void limitAccessToOwner() throws IOException {
FileUtil.limitAccessToOwner(this);
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java Tue Apr 1 09:04:37 2014
@@ -32,8 +32,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
import org.apache.derby.iapi.error.StandardException;
/**
@@ -401,12 +399,5 @@ abstract class InputStreamFile implement
return path;
}
- /**
- * @see org.apache.derby.io.StorageFile#getURL()
- */
- public URL getURL() throws MalformedURLException {
- throw new MalformedURLException(toString());
- }
-
public void limitAccessToOwner() {};
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/JarDBFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/JarDBFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/JarDBFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/JarDBFile.java Tue Apr 1 09:04:37 2014
@@ -22,20 +22,10 @@
package org.apache.derby.impl.io;
import org.apache.derby.io.StorageFile;
-import org.apache.derby.io.StorageRandomAccessFile;
-
-import org.apache.derby.shared.common.sanity.SanityManager;
-
-import java.io.File;
import java.io.InputStream;
-import java.io.OutputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
/**
* This class provides a jar file based implementation of the StorageFile interface. It is used by the
@@ -125,17 +115,4 @@ class JarDBFile extends InputStreamFile
{
return path;
}
- /**
- * Return a URL for this file (resource). Returns a URL according to the
- * spec for java.net.JarURLConnection
- *
- * @see org.apache.derby.io.StorageFile#getURL()
- */
- public URL getURL() throws MalformedURLException {
- File pathFile = new File(storageFactory.zipData.getName());
-
- String pathFileURL = pathFile.toURI().toURL().toString();
-
- return new URL("jar:" + pathFileURL + "!/" + path);
- }
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/VirtualFile.java Tue Apr 1 09:04:37 2014
@@ -161,11 +161,6 @@ public class VirtualFile
return PathUtil.getBaseName(path);
}
- public java.net.URL getURL()
- throws java.net.MalformedURLException {
- throw new UnsupportedOperationException("Not supported.");
- }
-
/**
* Creates the the file denoted by this virtual file object.
*
Modified: db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java Tue Apr 1 09:04:37 2014
@@ -25,8 +25,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.net.URL;
-import java.net.MalformedURLException;
import org.apache.derby.iapi.error.StandardException;
/**
@@ -132,14 +130,6 @@ public interface StorageFile
public String getName();
/**
- * Get a URL representing this file. A valid URL does not indicate the file exists,
- * it may just be a URL that will fail on opening. Some implementations
- * return null if the file does not exist.
- * @throws MalformedURLException File cannot be represented as a URL.
- */
- public URL getURL() throws MalformedURLException;
-
- /**
* If the named file does not already exist then create it as an empty normal file.
*
* The implementation
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java?rev=1583578&r1=1583577&r2=1583578&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java Tue Apr 1 09:04:37 2014
@@ -27,8 +27,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
import org.apache.derby.iapi.error.StandardException;
/**
@@ -362,12 +360,6 @@ class CorruptFile implements StorageFile
{
return realFile;
}
- /**
- * @see org.apache.derby.io.StorageFile#getURL()
- */
- public URL getURL() throws MalformedURLException {
- throw new MalformedURLException(toString());
- }
public void limitAccessToOwner() throws IOException {
realFile.limitAccessToOwner();