[jsword-svn] common/java/core/org/crosswire/common/util s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Mon Apr 4 17:33:24 MST 2005


Update of /cvs/jsword/common/java/core/org/crosswire/common/util
In directory www.crosswire.org:/tmp/cvs-serv3405/java/core/org/crosswire/common/util

Modified Files:
	LucidException.java NetUtil.java ReporterEvent.java 
Removed Files:
	RowProcessor.java RobustList.java TabbedFileReader.java 
Log Message:
Cleanup: remove unused libraries. Piddly software changes for consistency. Move unused code to limbo.

Index: ReporterEvent.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/ReporterEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ReporterEvent.java	6 Mar 2005 20:21:59 -0000	1.3
--- ReporterEvent.java	5 Apr 2005 00:33:22 -0000	1.4
***************
*** 79,86 ****
              return full;
          }
!         else
!         {
!             return full.substring(lastDot + 1);
!         }
      }
  
--- 79,83 ----
              return full;
          }
!         return full.substring(lastDot + 1);
      }
  

Index: NetUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/NetUtil.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** NetUtil.java	6 Mar 2005 20:21:59 -0000	1.17
--- NetUtil.java	5 Apr 2005 00:33:22 -0000	1.18
***************
*** 248,285 ****
              return new File(url.getFile());
          }
!         else
!         {
!             String hashString = (url.toExternalForm().hashCode() + "").replace('-', 'm'); //$NON-NLS-1$
! 
!             // get the location of the tempWorkingDir
!             File workingDir = getURLCacheDir();
!             File workingFile = null;
  
!             if (workingDir != null && workingDir.isDirectory())
!             {
!                 workingFile = new File(workingDir, hashString);
!             }
!             else
!             {
!                 // If there's no working dir, we just use temp...
!                 workingFile = File.createTempFile(hashString, TEMP_SUFFIX);
!             }
!             workingFile.deleteOnExit();
  
!             // copy the contents of the URL to the file
!             OutputStream output = new FileOutputStream(workingFile);
!             InputStream input = url.openStream();
  
!             byte[] data = new byte[512];
!             for (int read = 0; read != -1; read = input.read(data))
!             {
!                 output.write(data, 0, read);
!             }
!             input.close();
!             output.close();
  
!             // return the new file in URL form
!             return workingFile;
          }
      }
  
--- 248,282 ----
              return new File(url.getFile());
          }
!         String hashString = (url.toExternalForm().hashCode() + "").replace('-', 'm'); //$NON-NLS-1$
  
!         // get the location of the tempWorkingDir
!         File workingDir = getURLCacheDir();
!         File workingFile = null;
  
!         if (workingDir != null && workingDir.isDirectory())
!         {
!             workingFile = new File(workingDir, hashString);
!         }
!         else
!         {
!             // If there's no working dir, we just use temp...
!             workingFile = File.createTempFile(hashString, TEMP_SUFFIX);
!         }
!         workingFile.deleteOnExit();
  
!         // copy the contents of the URL to the file
!         OutputStream output = new FileOutputStream(workingFile);
!         InputStream input = url.openStream();
  
!         byte[] data = new byte[512];
!         for (int read = 0; read != -1; read = input.read(data))
!         {
!             output.write(data, 0, read);
          }
+         input.close();
+         output.close();
+ 
+         // return the new file in URL form
+         return workingFile;
      }
  
***************
*** 341,359 ****
                                     orig.getFile() + extra);
                  }
-                 else
-                 {
-                     return new URL(orig.getProtocol(),
-                                    orig.getHost(),
-                                    orig.getPort(),
-                                    orig.getFile() + File.separator + extra);
-                 }
-             }
-             else
-             {
                  return new URL(orig.getProtocol(),
                                 orig.getHost(),
                                 orig.getPort(),
!                                orig.getFile() + SEPARATOR + extra);
              }
          }
          catch (MalformedURLException ex)
--- 338,350 ----
                                     orig.getFile() + extra);
                  }
                  return new URL(orig.getProtocol(),
                                 orig.getHost(),
                                 orig.getPort(),
!                                orig.getFile() + File.separator + extra);
              }
+             return new URL(orig.getProtocol(),
+                            orig.getHost(),
+                            orig.getPort(),
+                            orig.getFile() + SEPARATOR + extra);
          }
          catch (MalformedURLException ex)
***************
*** 401,410 ****
              return new FileOutputStream(url.getFile(), append);
          }
!         else
!         {
!             URLConnection cnx = url.openConnection();
!             cnx.setDoOutput(true);
!             return cnx.getOutputStream();
!         }
      }
  
--- 392,398 ----
              return new FileOutputStream(url.getFile(), append);
          }
!         URLConnection cnx = url.openConnection();
!         cnx.setDoOutput(true);
!         return cnx.getOutputStream();
      }
  

--- RobustList.java DELETED ---

Index: LucidException.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/LucidException.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** LucidException.java	9 Mar 2005 02:25:57 -0000	1.7
--- LucidException.java	5 Apr 2005 00:33:22 -0000	1.8
***************
*** 139,146 ****
              return getMessage() + Msg.REASON + lex.getDetailedMessage();
          }
!         else
!         {
!             return getMessage() + Msg.REASON + cause.getMessage();
!         }
      }
  
--- 139,143 ----
              return getMessage() + Msg.REASON + lex.getDetailedMessage();
          }
!         return getMessage() + Msg.REASON + cause.getMessage();
      }
  

--- TabbedFileReader.java DELETED ---

--- RowProcessor.java DELETED ---



More information about the jsword-svn mailing list