You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Myrna van Lunteren <m....@gmail.com> on 2006/11/10 20:18:01 UTC
Re: svn commit: r473416 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
On 11/10/06, djd@apache.org <dj...@apache.org> wrote:
> Author: djd
> Date: Fri Nov 10 10:30:50 2006
> New Revision: 473416
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=473416
> Log:
> DERBY-537 (partial) Cleanup JarUtil removing code that is never called and making class package private.
>
> Modified:
> db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
>
> Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
> URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java?view=diff&rev=473416&r1=473415&r2=473416
> ==============================================================================
> --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java (original)
> +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java Fri Nov 10 10:30:50 2006
> @@ -48,12 +48,8 @@
> import java.sql.Connection;
> import java.sql.SQLException;
>
> -public class JarUtil
> +class JarUtil
> {
> - public static final String ADD_JAR_DDL = "ADD JAR";
> - public static final String DROP_JAR_DDL = "DROP JAR";
> - public static final String REPLACE_JAR_DDL = "REPLACE JAR";
> - public static final String READ_JAR = "READ JAR";
> //
> //State passed in by the caller
> private UUID id; //For add null means create a new id.
> @@ -68,7 +64,7 @@
>
> //
> //State derived from the caller's context
> - public JarUtil(UUID id, String schemaName, String sqlName)
> + private JarUtil(UUID id, String schemaName, String sqlName)
> throws StandardException
> {
> this.id = id;
> @@ -93,7 +89,7 @@
>
> @exception StandardException Opps
> */
> - static public long
> + static long
> add(UUID id, String schemaName, String sqlName, String externalPath)
> throws StandardException
> {
> @@ -121,7 +117,7 @@
> @param is A stream for reading the content of the file to add.
> @exception StandardException Opps
> */
> - public long add(InputStream is) throws StandardException
> + private long add(InputStream is) throws StandardException
> {
> //
> //Like create table we say we are writing before we read the dd
> @@ -160,7 +156,7 @@
>
> @exception StandardException Opps
> */
> - static public void
> + static void
> drop(UUID id, String schemaName, String sqlName,boolean purgeOnCommit)
> throws StandardException
> {
> @@ -179,7 +175,7 @@
>
> @exception StandardException Opps
> */
> - public void drop(boolean purgeOnCommit) throws StandardException
> + private void drop(boolean purgeOnCommit) throws StandardException
> {
> //
> //Like create table we say we are writing before we read the dd
> @@ -249,7 +245,7 @@
>
> @exception StandardException Opps
> */
> - static public long
> + static long
> replace(UUID id,String schemaName, String sqlName,
> String externalPath,boolean purgeOnCommit)
> throws StandardException
> @@ -283,7 +279,7 @@
> means leave it around for use by replication.
> @exception StandardException Opps
> */
> - public long replace(InputStream is,boolean purgeOnCommit) throws StandardException
> + private long replace(InputStream is,boolean purgeOnCommit) throws StandardException
> {
> //
> //Like create table we say we are writing before we read the dd
> @@ -333,22 +329,6 @@
> }
>
> /**
> - Get the FileInfoDescriptor for a jar file from the current connection's database or
> - null if it does not exist.
> -
> - @param schemaName the name for the schema that holds the jar file.
> - @param sqlName the sql name for the jar file.
> - @return The FileInfoDescriptor.
> - @exception StandardException Opps
> - */
> - public static FileInfoDescriptor getInfo(String schemaName, String sqlName, String statementType)
> - throws StandardException
> - {
> - JarUtil jUtil = new JarUtil(null,schemaName,sqlName);
> - return jUtil.getInfo();
> - }
> -
> - /**
> Get the FileInfoDescriptor for the Jar file or null if it does not exist.
> @exception StandardException Ooops
> */
> @@ -357,44 +337,6 @@
> {
> SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> return dd.getFileInfoDescriptor(sd,sqlName);
> - }
> -
> - // get the current version of the jar file as a File or InputStream
> - public static Object getAsObject(String schemaName, String sqlName)
> - throws StandardException
> - {
> - JarUtil jUtil = new JarUtil(null,schemaName,sqlName);
> -
> - FileInfoDescriptor fid = jUtil.getInfo();
> - if (fid == null)
> - throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);
> -
> - long generationId = fid.getGenerationId();
> -
> - StorageFile f = jUtil.getAsFile(generationId);
> - if (f != null)
> - return f;
> -
> - return jUtil.getAsStream(generationId);
> - }
> -
> - private StorageFile getAsFile(long generationId) {
> - return fr.getAsFile(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()), generationId);
> - }
> -
> - public static InputStream getAsStream(String schemaName, String sqlName,
> - long generationId) throws StandardException {
> - JarUtil jUtil = new JarUtil(null,schemaName,sqlName);
> -
> - return jUtil.getAsStream(generationId);
> - }
> -
> - private InputStream getAsStream(long generationId) throws StandardException {
> - try {
> - return fr.getAsStream(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()), generationId);
> - } catch (IOException ioe) {
> - throw StandardException.newException(SQLState.LANG_FILE_ERROR, ioe, ioe.toString());
> - }
> }
>
> private void notifyLoader(boolean reload) throws StandardException {
>
>
>
Dan,
I think this may be causing a build error for me:
compile_impl_services_169:
[javac] Compiling 52 source files to C:\derbyt\svn2\trunk\classes
[javac] C:\derbyt\svn2\trunk\java\engine\org\apache\derby\impl\services\reflect\JarLoader.java:24:
org.apache.derby.impl.sql.execute.JarUtil is not public in
org.apache.derby.impl.sql.execute; cannot be accessed from outside
package
[javac] import org.apache.derby.impl.sql.execute.JarUtil;
[javac] ^
[javac] 1 error
[javac] Compile failed; see the compiler error output for details.
compile_impl_io_169:
compile:
compile_impl_services_169:
[javac] Compiling 52 source files to C:\derbyt\svn2\trunk\classes
[javac] C:\derbyt\svn2\trunk\java\engine\org\apache\derby\impl\services\reflect\JarLoader.java:24:
org.apache.derby.impl.sql.execute.JarUtil is not public in
org.apache.derby.impl.sql.execute; cannot be accessed from outside
package
[javac] import org.apache.derby.impl.sql.execute.JarUtil;
[javac] ^
[javac] 1 error
[javac] Compile failed; see the compiler error output for details.
Or am I missing something?
Thx,
Myrna