[Schmitzm-commits] r2260 - in trunk/schmitzm-core: . src/main/java/de/schmitzm/io src/main/java/de/schmitzm/swing src/main/java/de/schmitzm/versionnumber src/main/resources/de/schmitzm src/main/resources/de/schmitzm/io src/main/resources/de/schmitzm/io/resource src/main/resources/de/schmitzm/io/resource/locales src/main/resources/de/schmitzm/swing/resource/locales

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 1 00:17:31 CET 2013


Author: mojays
Date: 2013-03-01 00:17:31 +0100 (Fri, 01 Mar 2013)
New Revision: 2260

Added:
   trunk/schmitzm-core/src/main/resources/de/schmitzm/io/
   trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/
   trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/
   trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle.properties
   trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle_de.properties
Modified:
   trunk/schmitzm-core/pom.xml
   trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtilBasic.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseControl.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseUpdater.java
   trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle.properties
   trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties
Log:
schmitzm-core/pom.xml:
- IOResourceBundle added to execution of ResourceProviderOperator
IOUtil:
- new variants of createTemporaryFile(.) and getApplicationCommand(.);
- BugFix in createApplicationStartCommand(.) (for "startedFromClasspath" flag);
- Exception handling in downloadUrlToFile(.) refined;
- new methods getApplicationFile/Filename/Filepath(.);
- new methods renameFile(.);
IOUtilBasic:
- new methods renameFile(.)
SwingUtil:
- performReleaseUpdateWithProgressBar(.) modified/refined
ReleaseUpdater:
- new method getApplicationFileName()
- update check deactivated when running from classpath
ReleaseControl:
- java doc updated


Modified: trunk/schmitzm-core/pom.xml
===================================================================
--- trunk/schmitzm-core/pom.xml	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/pom.xml	2013-02-28 23:17:31 UTC (rev 2260)
@@ -173,7 +173,7 @@
 										<argument>-s</argument>
 										<argument>${basedir}/src/main/resources</argument>
 										<argument>-b</argument>
-										<argument>de.schmitzm.swing.resource.locales.SwingResourceBundle;de.schmitzm.lang.resource.locales.LangResourceBundle;de.schmitzm.net.mail.resource.locales.MailResourceBundle;de.schmitzm.data.resource.locales.DataResourceBundle
+										<argument>de.schmitzm.swing.resource.locales.SwingResourceBundle;de.schmitzm.lang.resource.locales.LangResourceBundle;de.schmitzm.net.mail.resource.locales.MailResourceBundle;de.schmitzm.data.resource.locales.DataResourceBundle;de.schmitzm.io.resource.locales.IOResourceBundle
 										</argument>
 									</arguments>
 								</configuration>

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2013-02-28 23:17:31 UTC (rev 2260)
@@ -66,6 +66,7 @@
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.Locale;
 import java.util.Vector;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -85,6 +86,7 @@
 import de.schmitzm.console.ConsoleDevice;
 import de.schmitzm.console.TextDevice;
 import de.schmitzm.lang.LangUtil;
+import de.schmitzm.lang.ResourceProvider;
 import de.schmitzm.swing.SwingUtil;
 
 /**
@@ -101,6 +103,22 @@
 	  LangUtil.initializeDefaultLogger(Level.DEBUG, null);
 	}
 	
+    /**
+     * {@link ResourceProvider} for the locatlization of components in
+     * package {@code de.schmitzm.io}. These are stored in properties-files
+     * underneath {@code de.schmitzm.io.resource.locales}.
+     */
+    public static ResourceProvider RESOURCE = ResourceProvider.newInstance(
+            LangUtil.extendPackagePath(IOUtil.class,
+                    "resource.locales.IOResourceBundle"), Locale.ENGLISH);
+
+    /**
+     * Convenience method to access the translation resources.
+     */
+    public static String R(String key, Object... values) {
+        return RESOURCE.getString(key, values);
+    }
+	
 	/**
 	 * Global {@link ConnectionSettings} which are used, when no explicit
 	 * {@link Proxy} is given for several methods. Can also be used for 
@@ -591,13 +609,37 @@
 
     /**
      * Creates a file a local temporary directory.
+     * @param name filename (will NOT be extended by unique key)
+     * @param deleteOnExit indicates whether file is automatically deleted after JVM is finished 
+     */
+    public static File createTemporaryFile(String name, boolean deleteOnExit) throws IOException {
+      File file = new File(getTempDir(),name);
+      if ( deleteOnExit )
+        file.deleteOnExit();
+      return file;
+    }
+
+    /**
+     * Creates a file a local temporary directory.
      * @param prefix prefix of filename (automatically extended by unique key)
      * @param suffix file extension for temporary file including dot "." (if {@code null}
      *               ".tmp" will be used)
      * @param deleteOnExit indicates whether file is automatically deleted after JVM is finished 
      */
     public static File createTemporaryFile(String prefix, String suffix, boolean deleteOnExit) throws IOException {
-      File file = File.createTempFile(prefix,suffix);
+      return createTemporaryFile(null, prefix, suffix, deleteOnExit);
+    }
+    
+    /**
+     * Creates a temporary file
+     * @param dir    directory the file is created in.
+     * @param prefix prefix of filename (automatically extended by unique key)
+     * @param suffix file extension for temporary file including dot "." (if {@code null}
+     *               ".tmp" will be used)
+     * @param deleteOnExit indicates whether file is automatically deleted after JVM is finished 
+     */
+    public static File createTemporaryFile(File dir, String prefix, String suffix, boolean deleteOnExit) throws IOException {
+      File file = File.createTempFile(prefix,suffix,dir);
       if ( deleteOnExit )
         file.deleteOnExit();
       return file;
@@ -717,7 +759,7 @@
      * @param maxRetries number of download retries in case of any error
      * @param user user for http authentication (if {@code null}, authentication is tried to determine from
      *             URL {@code user:password})
-     * @param password password for http authentication 
+     * @param password password for http authentication
      */
     public static File downloadUrlToFile(URL url, Proxy proxy, File file, int connTimeout, int readTimeout, int maxRetries, String user, String password) throws IOException {
       if ( file == null )
@@ -811,6 +853,12 @@
           LOGGER.debug("Download completed: "+url+" to "+file);
           break;
         } catch ( IOException err ) {
+          // if error is not located to remote file, there is no need
+          // for retries, to we throw an Exception immediately
+          if ( err instanceof FileNotFoundException &&
+               !err.getMessage().contains("://") )
+            throw new IOException(R("IOUtil.downloadUrlToFile.err.local.file",err.getMessage()),err);
+          // on remote errors we retry
           if ( maxRetries > 0 ) {
             LOGGER.warn("Error downloading "+url+": "+err.getMessage());
             if ( retry < maxRetries ) {
@@ -818,6 +866,10 @@
               continue;
             }
           }
+          // if all retries fail and FileNotFoundException we throw a special message
+          if ( err instanceof FileNotFoundException )
+            throw new FileNotFoundException(R("IOUtil.downloadUrlToFile.err.remote.file",err.getMessage()));
+          // otherwise we throw the error
           throw err;
         }
 
@@ -1202,7 +1254,35 @@
 		}
 		return delCount;
 	}
+	
+    /**
+     * Renames (or moves) a file.
+     * @param source file to rename (or move) 
+     * @param dest destination directory for move or simply the new filename (if {@code dest} does
+     *             not define an absolute path, it is interpreted relatively to {@code source}; if {@code dest}
+     *             specifies a directory the filename remains unchanged)
+     * @param replace indicates whether the destination file is automatically replaced/deleted if
+     *                it already exists
+     * @return {@code null} if rename/move could not be applied (because destination file already exists) 
+     */
+    public static File renameFile(File source, String dest, boolean replace) {
+      return IOUtilBasic.renameFile(source, new File(dest), replace);
+    }
 
+    /**
+     * Renames (or moves) a file.
+     * @param source file to rename (or move) 
+     * @param dest destination directory for move or simply the new filename (if {@code dest} does
+     *             not define an absolute path, it is interpreted relatively to {@code source}; if {@code dest}
+     *             specifies a directory the filename remains unchanged)
+     * @param replace indicates whether the destination file is automatically replaced/deleted if
+     *                it already exists
+     * @return {@code null} if rename/move could not be applied (because destination file already exists) 
+     */
+    public static File renameFile(File source, File dest, boolean replace) {
+      return IOUtilBasic.renameFile(source, dest, replace);
+	}
+
 	/**
 	 * Fuehrt verschiedene Funktionen aus.
 	 * <ul>
@@ -2645,15 +2725,84 @@
       return null;
     }
 
+
     /**
      * Returns the start command from system properties ("sun.java.command"). 
      */
     public static String getApplicationCommand() {
+      return getApplicationCommand(true);
+    }
+
+    /**
+     * Returns the start command from system properties ("sun.java.command").
+     * @param inclParams if {@code false} the command line parameters are
+     *                   removed from command 
+     */
+    public static String getApplicationCommand(boolean inclParams) {
       String startCommand = System.getProperty("sun.java.command");
+      if ( !inclParams ) {
+        int idx = determineCommandLineParametersIndex(startCommand);
+        if ( idx > 0 )
+          startCommand = startCommand.substring(0,idx).trim();
+      }
       return startCommand;
     }
     
     /**
+     * Reconstructs the application file of the running application (JAR, EXE, etc.).
+     * @return {@code null} if application was started from class path
+     */
+    public static File getApplicationFile() {
+      String startCommandWithoutParams = getApplicationCommand(false);
+      String mainClassName = getApplicationMainClassName(); 
+      // If application was started from classpath there is no filename
+      if ( startCommandWithoutParams.equalsIgnoreCase(mainClassName) ) 
+          return null;
+
+      // if application was started from JAR file and main class was specified
+      // we remove the main class
+      int idx = startCommandWithoutParams.indexOf(mainClassName);
+      if ( idx >= 0 )
+        startCommandWithoutParams = startCommandWithoutParams.substring(0,idx).trim();
+      
+      // if application was started from JAR file the system property only
+      // contains the jar file (with relative path)!
+      // -> extend command by application path 
+      if ( startCommandWithoutParams.toLowerCase().endsWith(".jar") ) 
+        startCommandWithoutParams = new File(startCommandWithoutParams).getAbsolutePath();
+    
+      return new File(startCommandWithoutParams);
+    }
+
+    /**
+     * Reconstructs the application filename without path information and command line
+     * parameters of the running application (JAR, EXE, etc.).
+     * @return {@link #getApplicationMainClass()} if application was started from
+     *         class path
+     */
+    public static String getApplicationFilename() {
+      File file = getApplicationFile();
+      // If application was started from classpath there is no filename
+      if ( file == null )
+        return getApplicationMainClassName();
+      return file.getName();
+    }
+
+    /**
+     * Reconstructs the application file with path information but without command line
+     * parameters of the running application (JAR, EXE, etc.).
+     * @return {@link #getApplicationMainClass()} if application was started from
+     *         class path
+     */
+    public static String getApplicationFilepath() {
+      File file = getApplicationFile();
+      // If application was started from classpath there is no filename
+      if ( file == null )
+        return getApplicationMainClassName();
+      return file.getAbsolutePath();
+    }
+
+    /**
      * Reconstructs the complete command line command (incl. path, java call, etc.) to (re)run
      * the running application (JAR, EXE, etc.) from command line.
      */
@@ -2708,7 +2857,7 @@
 	  String mainClassName = getApplicationMainClassName();
 	  
 	  boolean startedFromJAR        = startCommandWithoutParams.toLowerCase().endsWith(".jar");
-      boolean startedFromClasspath  = startCommandWithoutParams.toLowerCase().endsWith(mainClassName);
+      boolean startedFromClasspath  = startCommandWithoutParams.endsWith(mainClassName);
       boolean startedFromExecutable = !startedFromJAR && !startedFromClasspath;
 	  
 	  // if application was started from JAR file the system property only

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtilBasic.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtilBasic.java	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtilBasic.java	2013-02-28 23:17:31 UTC (rev 2260)
@@ -39,15 +39,71 @@
  *
  */
 public class IOUtilBasic {
+  /**
+   * Renames (or moves) a file.
+   * @param source file to rename (or move) 
+   * @param dest destination directory for move or simply the new filename (if {@code dest} does
+   *             not define an absolute path, it is interpreted relatively to {@code source}; if {@code dest}
+   *             specifies a directory the filename remains unchanged)
+   * @param replace indicates whether the destination file is automatically replaced/deleted if
+   *                it already exists
+   * @return {@code null} if rename/move could not be applied (because destination file already exists) 
+   */
+  public static File renameFile(File source, String dest, boolean replace) {
+    return renameFile(source, new File(dest), replace);
+  }
 
   /**
+   * Renames (or moves) a file.
+   * @param source file to rename (or move) 
+   * @param dest destination directory for move or simply the new filename (if {@code dest} does
+   *             not define an absolute path, it is interpreted relatively to {@code source}; if {@code dest}
+   *             specifies a directory the filename remains unchanged)
+   * @param replace indicates whether the destination file is automatically replaced/deleted if
+   *                it already exists
+   * @return {@code null} if rename/move could not be applied (because destination file already exists) 
+   */
+  public static File renameFile(File source, File dest, boolean replace) {
+    if ( !dest.isAbsolute() )
+      dest = new File(source.getParentFile(),dest.getPath());
+    if ( dest.isDirectory() )
+      dest = new File(dest,source.getName());
+    if ( dest.exists() ) {
+      if ( replace )
+        dest.delete();
+      else
+        return null;
+    }
+    if ( !source.renameTo(dest) )
+      return null;
+    return dest;
+  }
+  
+  /**
+   * Masks a path which contains whitespaces with quote signs. May only work on WINDOWS
+   * systems. But because we do not want to use {@code SystemsUtils}, we ignore that :-(
+   */
+  public static String maskPath(String path) {
+    path = path.trim();
+    // if there is no need for mask, return the original path
+    if ( path.indexOf(' ') < 0 && path.indexOf('\t') < 0 )
+      return path;
+    
+    String maskChar = "\""; // Default
+    // if path already masked, there is no need to mask twice
+    if ( path.startsWith(maskChar) && path.endsWith(maskChar) )
+      return path;
+    path = maskChar + path + maskChar;
+    
+    return path;
+  }
+
+  /**
      * Executes one of the following commands:
      * <ul>
-     * <li>{@code COPY source dest delayMillis}<br>
-     *     Copy a file on the file system.</li>
      * <li>{@code MOVE source dest delaMillis}<br>
      *     Moved a file on the file system.</li>
-     * <li>{@code EXEC delayMillies command}<br>
+     * <li>{@code EXEC delayMillies command args}<br>
      *     Executes an OS command.</li>
      * </ul>
    */
@@ -58,8 +114,8 @@
     }
 
     String func = arg[0].toUpperCase();
-    if (func.equals("COPY") || func.equals("MOVE")) {
-      // ###### COPY / MOVE ######
+    if ( func.equals("MOVE") ) {
+      // ###### MOVE ######
       if (arg.length < 3) {
         System.err.println("Missing arguments for "+func+".");
         return;
@@ -69,10 +125,9 @@
         Thread.sleep(delay);
       }
       File source = new File(arg[1]);
-      File dest   = new File(arg[2]);
-      source.renameTo(dest);
-      if ( func.equals("MOVE") )
-        source.delete();
+      File sourceMoved = renameFile(source, arg[2], true);
+      if ( sourceMoved == null )
+        System.err.println("Could not move "+arg[1]+" to "+arg[2]);
     } else if ( func.equals("EXEC") ) {
       // ###### EXEC ######      
       if (arg.length < 3) {
@@ -83,7 +138,7 @@
       Thread.sleep(delay);
       String command = "";
       for (int i=2; i<arg.length; i++)
-        command += " " + arg[i];
+        command += " " + maskPath(arg[i]);
       Runtime.getRuntime().exec(command);
     } else {
       System.err.println("Unknown function: " + func);

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2013-02-28 23:17:31 UTC (rev 2260)
@@ -2885,19 +2885,22 @@
     
     /**
      * Uses a {@link ReleaseUpdater} to check online for application update. If new release is available
-     * it is downloaded. 
+     * it is downloaded.
      * @param parent        parent frame used for status dialogs
      * @param updater       update used to check for application updated
      * @param destFile      local destination file for download (if {@code null} a temporary file in
      *                      user temp folder is created, which will be deleted after application exit!)
      * @param askForUpdate  indicates whether user is asked before starting the download
-     * @param updaterFileName (base) name of the an updater program/jar which is additionally downloaded
+     * @param showNoUpdateMess indicates whether message is shown if no update is available
+     * @param updaterFilename (base) name of the an updater program/jar which is additionally downloaded
      *                        to the same directory as {@code destFile};
      *                        it can be used to install/copy the downloaded application file to destination
      *                        directory (if {@code null} the updater will be ignored)   
+     * @param updaterDestFile local destination file the updater is downloaded to; if {@code null} the updater
+     *                        is downloaded to same directory as {@code destFile}  
      * @return the downloaded file or {@code null} if the update check or download progress was canceled
      */
-    public static File performReleaseUpdateWithProgressBar(Frame parent, final ReleaseUpdater updater, File destFile, boolean askForUpdate, boolean showNoUpdateMess, String updaterFilename) throws IOException {
+    public static File performReleaseUpdateWithProgressBar(Frame parent, final ReleaseUpdater updater, File destFile, boolean askForUpdate, boolean showNoUpdateMess, String updaterFilename, File updaterDestFile) throws IOException {
       // We want to do a new online check for update, so we clear
       // any cached update information
       updater.clearCache();
@@ -2941,10 +2944,11 @@
         String downloadSizeStr = LangUtil.formatFileSize(downloadSize);
         int ret = JOptionPane.showConfirmDialog(parent,
                                                 R("SwingUtil.releaseUpdate.available.mess",
+                                                  updater.getApplicationFileName(),
                                                   latestBuild,
                                                   updater.getReleaseBaseUrl(),
                                                   downloadSizeStr),
-                                                "SwingUtil.releaseUpdate.available.title",
+                                                R("SwingUtil.releaseUpdate.available.title"),
                                                 JOptionPane.YES_NO_OPTION,
                                                 JOptionPane.QUESTION_MESSAGE);
         if ( ret != JOptionPane.YES_OPTION ) {
@@ -2954,8 +2958,10 @@
       
       // Download file(s)
       final File downloadFile = (destFile != null) ? destFile : IOUtil.createTemporaryFile(updater.getLastestReleaseFileName(), null, true);
-      final File updaterFile  = updaterFilename == null ? null : new File(downloadFile.getParent(),updaterFilename);
-      final URL  updaterURL   = updaterFilename == null ? null : IOUtil.extendURL(updater.getReleaseBaseUrl(),updaterFile.getName());
+      
+      
+      final URL  updaterURL   = updaterFilename == null ? null : IOUtil.extendURL(updater.getReleaseBaseUrl(),updaterFilename);
+      final File updaterFile  = updaterFilename == null ? null : ( updaterDestFile != null ? updaterDestFile : new File(downloadFile.getParent(),updaterFilename));
       final int  updaterSize  = updaterFilename == null ? 0    : IOUtil.determineUrlFileSize(updaterURL,
                                                                                              IOUtil.getGlobalConnectionSettings(),
                                                                                              updater.getHttpAuthUser(), 
@@ -2964,6 +2970,8 @@
       final SwingWorker.Work downloadWork = new SwingWorker.Work() {
         @Override
         public Object execute() throws Exception {
+          if ( downloadFile.exists() )
+            downloadFile.delete();
           // Download updater
           if ( updaterExists )
             IOUtil.downloadUrlToFile(updaterURL,
@@ -2986,21 +2994,15 @@
           setProgressRange(0, downloadSize+updaterSize);
           while (downloadWorker.isAlive()) {
             setProgress((int)downloadFile.length() + (int)updaterFile.length());
-            Thread.sleep(100);
+//            Thread.sleep(100);
           }
           return null;
         }
       };
-      final SwingWorker progressWorker = new SwingWorker(progressWork, parent, R("SwingUtil.releaseUpdate.download.mess",latestBuild));
+      final SwingWorker progressWorker = new SwingWorker(progressWork, parent, R("SwingUtil.releaseUpdate.download.mess",updater.getApplicationFileName(),latestBuild));
       progressWorker.start();
-      if ( progressWorker.isCanceled() ) {
+      if ( progressWorker.isCanceled() )
         downloadWorker.terminate();
-        downloadFile.delete();
-        if ( updaterFile != null )
-          updaterFile.delete();
-      }
-      
-      // return downloaded file
       return (File)downloadWorker.getWorkResult();
     }
 

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseControl.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseControl.java	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseControl.java	2013-02-28 23:17:31 UTC (rev 2260)
@@ -192,7 +192,7 @@
   
   /**
    * Checks whether the current application version fits the required version
-   * set in the database
+   * set in the database. If not a {@link ReleaseException} is thrown.
    * @param connURL  database connection URL
    * @param user     database user used for database connection
    * @param password password used for database connection
@@ -208,7 +208,7 @@
   
   /**
    * Checks whether the current application version fits the required version
-   * set in the database
+   * set in the database. If not a {@link ReleaseException} is thrown.
    * @param conn  database connection
    */
   public void checkApplicationRelease(Connection conn) throws SQLException {

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseUpdater.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseUpdater.java	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/versionnumber/ReleaseUpdater.java	2013-02-28 23:17:31 UTC (rev 2260)
@@ -148,6 +148,15 @@
   }
 
   /**
+   * Returns the application file name the updater checks for
+   * latest build.
+   * @see ReleaseUtil
+   */
+  public String getApplicationFileName() {
+    return applFileName;
+  }
+
+  /**
    * Returns the user name the updater uses to authenticate http connection.
    */
   public String getHttpAuthUser() {
@@ -253,8 +262,8 @@
     // determine build of running application
     String currApplBuildStr = ReleaseUtil.getVersionBuild(releaseClass);
     long currApplBuild = parseLong(currApplBuildStr);
-//    if ( currApplBuild <= 0 )
-//      throw new IOException("No release build set for running application. Can not check for release update!");
+    if ( currApplBuild <= 0 )
+      throw new IOException("No release build set for running application. Can not check for release update!");
     // determine build of latest version
     String latestApplBuildStr = determineLastestBuild();
     long latestApplBuild = parseLong(latestApplBuildStr);

Added: trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle.properties
===================================================================
--- trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle.properties	                        (rev 0)
+++ trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle.properties	2013-02-28 23:17:31 UTC (rev 2260)
@@ -0,0 +1,36 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+# -----------------------------------------------------------
+# ------ Default Translations (english) for components ------
+# ------ in Package de.schmitzm.io                     ------
+# -----------------------------------------------------------
+
+IOUtil.downloadUrlToFile.err.local.file=Download file can not be saved (locally): ${0}
+IOUtil.downloadUrlToFile.err.remote.file=Download file can not be accessed on server: ${0}

Added: trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle_de.properties
===================================================================
--- trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle_de.properties	                        (rev 0)
+++ trunk/schmitzm-core/src/main/resources/de/schmitzm/io/resource/locales/IOResourceBundle_de.properties	2013-02-28 23:17:31 UTC (rev 2260)
@@ -0,0 +1,36 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+# ------------------------------------------------
+# ------ German Translations for components ------
+# ------ in Package de.schmitzm.io          ------
+# ------------------------------------------------
+
+IOUtil.downloadUrlToFile.err.local.file=Download-Datei kann (lokal) nicht gespeichert werden ${0}
+IOUtil.downloadUrlToFile.err.remote.file=Datei kann nicht vom Server geladen werden: ${0}

Modified: trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle.properties
===================================================================
--- trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle.properties	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle.properties	2013-02-28 23:17:31 UTC (rev 2260)
@@ -287,9 +287,9 @@
 SwingUtil.releaseUpdate.check.mess=Checking ${0} for update...
 SwingUtil.releaseUpdate.none.mess=Your application is up-to-date.
 SwingUtil.releaseUpdate.none.title=No update available
-SwingUtil.releaseUpdate.available.mess=A new release (v${0}) is available on ${1}.\nDo you want to download the update (${2})?
+SwingUtil.releaseUpdate.available.mess=A new release (${0} r${1}) is available on ${2}.\nDo you want to download the update (${3})?
 SwingUtil.releaseUpdate.available.title=Update available
-SwingUtil.releaseUpdate.download.mess=Downloading release v${0}
+SwingUtil.releaseUpdate.download.mess=Downloading ${0} release r${1}
 
 InfoDialog.Title=Info...
 InfoDialog.Header.Parameter=Parameter

Modified: trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties
===================================================================
--- trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties	2013-02-27 00:03:18 UTC (rev 2259)
+++ trunk/schmitzm-core/src/main/resources/de/schmitzm/swing/resource/locales/SwingResourceBundle_de.properties	2013-02-28 23:17:31 UTC (rev 2260)
@@ -259,9 +259,9 @@
 SwingUtil.releaseUpdate.check.mess=Pr\u00fcfe ${0} auf verf\u00fcgbare Aktualisierungen...
 SwingUtil.releaseUpdate.none.mess=Ihr Programm ist auf dem aktuellen Stand.
 SwingUtil.releaseUpdate.none.title=Keine Aktualisierung verf\u00fcgbar
-SwingUtil.releaseUpdate.available.mess=Eine neue Programmversion (v${0}) ist verf\u00fcgbar auf ${1}.\nM\u00f6chten Sie das Update (${2}) herunterladen?
+SwingUtil.releaseUpdate.available.mess=Eine neue Programmversion (${0} r${1}) ist verf\u00fcgbar auf ${2}.\nM\u00f6chten Sie das Update (${3}) herunterladen?
 SwingUtil.releaseUpdate.available.title=Aktualisierung verf\u00fcgbar
-SwingUtil.releaseUpdate.download.mess=Download der Programmversion v${0}
+SwingUtil.releaseUpdate.download.mess=Download von ${0}, Programmversion r${1}
 
 InfoDialog.Title=Info...
 InfoDialog.Header.Parameter=Parameter



More information about the Schmitzm-commits mailing list