ICU-5606 updated icutzu for demoing
X-SVN-Rev: 21070
This commit is contained in:
parent
d95dc40cd3
commit
71f2d49b40
@ -100,7 +100,8 @@
|
|||||||
<property name="ime.indic.manifest" value="${src.dir}/com/ibm/icu/dev/tool/ime/indic/manifest.stub"/>
|
<property name="ime.indic.manifest" value="${src.dir}/com/ibm/icu/dev/tool/ime/indic/manifest.stub"/>
|
||||||
<property name="zip.file" value="../icu4j${DSTAMP}.zip"/>
|
<property name="zip.file" value="../icu4j${DSTAMP}.zip"/>
|
||||||
<property name="zipSrc.file" value="../icu4jSrc${DSTAMP}.zip"/>
|
<property name="zipSrc.file" value="../icu4jSrc${DSTAMP}.zip"/>
|
||||||
|
<property name="tzu.bin.dir" value="${basedir}/ICU4JTZU"/>
|
||||||
|
<property name="tzujar.file" value="${tzu.bin.dir}/icutzu.jar"/>
|
||||||
<property file="build.properties" />
|
<property file="build.properties" />
|
||||||
<!-- fix the data folder every time there is a version update-->
|
<!-- fix the data folder every time there is a version update-->
|
||||||
|
|
||||||
@ -2457,4 +2458,50 @@
|
|||||||
<target name="jdk13Compat" depends="init, eclipseCoreMangle, core13" description="builds ICU4J core with JDK 1.3"/>
|
<target name="jdk13Compat" depends="init, eclipseCoreMangle, core13" description="builds ICU4J core with JDK 1.3"/>
|
||||||
<target name="jdk13CompatTests" depends="init, jdk13Compat, eclipseTestMangle, eclipseTests" description="builds ICU4J tests with JDK 1.3"/>
|
<target name="jdk13CompatTests" depends="init, jdk13Compat, eclipseTestMangle, eclipseTests" description="builds ICU4J tests with JDK 1.3"/>
|
||||||
<target name="jdk13CompatCheck" depends="init, jdk13CompatTests, jar13, deleteCore, eclipseRunCheck" description="runs the tests with JDK 1.3"/>
|
<target name="jdk13CompatCheck" depends="init, jdk13CompatTests, jar13, deleteCore, eclipseRunCheck" description="runs the tests with JDK 1.3"/>
|
||||||
|
<target name="icutzu" depends="init" description="build ICU4J TimeZone Update Utility Classes">
|
||||||
|
<javac includes="com/ibm/icu/dev/tool/tzu/**/*.java"
|
||||||
|
excludes="**/.svn/**/*"
|
||||||
|
srcdir="${src.dir}"
|
||||||
|
destdir="${build.dir}"
|
||||||
|
classpathref="build.classpath"
|
||||||
|
source="${icu4j.javac.source}"
|
||||||
|
target="${icu4j.javac.target}"
|
||||||
|
debug="on" deprecation="off"
|
||||||
|
encoding="ascii"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="icutzujar" depends="init,icutzu,jar" description="build ICU4J TimeZone Update Utility Classes">
|
||||||
|
<mkdir dir="${tzu.bin.dir}"/>
|
||||||
|
<copy todir="${tzu.bin.dir}">
|
||||||
|
<fileset dir="${src.dir}/com/ibm/icu/dev/tool/tzu">
|
||||||
|
<include name="*.bat"/>
|
||||||
|
<include name="*.sh"/>
|
||||||
|
<include name="*.res"/>
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${basedir}">
|
||||||
|
<include name="${jar.file}"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<echo file="${tzu.bin.dir}/DirectorySearch.txt">all</echo>
|
||||||
|
<jar jarfile="${tzujar.file}" compress="true">
|
||||||
|
<fileset dir="${basedir}" includes="license.html" />
|
||||||
|
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/tool/tzu/**/*.class"/>
|
||||||
|
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/tool/UOption*.*"/>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Built-By" value="${corp}"/>
|
||||||
|
<section name="common">
|
||||||
|
<attribute name="Specification-Title" value="ICU4J TimeZone Update Utility"/>
|
||||||
|
<attribute name="Specification-Version" value="${icu4j.version.string}"/>
|
||||||
|
<attribute name="Specification-Vendor" value="ICU"/>
|
||||||
|
<attribute name="Implementation-Title" value="ICU4JTZU"/>
|
||||||
|
<attribute name="Implementation-Version" value="${icu4j.version.string}"/>
|
||||||
|
<attribute name="Implementation-Vendor" value="${corp}"/>
|
||||||
|
<attribute name="Implementation-Vendor-Id" value="com.ibm"/>
|
||||||
|
<attribute name="Copyright-Info" value="${copyright}"/>
|
||||||
|
<attribute name="Sealed" value="false"/>
|
||||||
|
</section>
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
<echo message="Please see ${tzu.bin.dir} directory for the files."/>
|
||||||
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
@ -18,32 +18,37 @@ public class CLILoader {
|
|||||||
|
|
||||||
public CLILoader(String[] args) {
|
public CLILoader(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
// make sure the result model hides unreadable/unwritable files
|
||||||
resultModel.setHidden(false);
|
resultModel.setHidden(false);
|
||||||
|
|
||||||
boolean nogui = "true".equals(System.getProperty("nogui"));
|
// set some options to be true based on environment variables
|
||||||
boolean discoveronly = "true".equals(System
|
if ("true".equals(System.getProperty("discoveronly")))
|
||||||
.getProperty("discoveronly"));
|
options[DISCOVERONLY].doesOccur = true;
|
||||||
boolean silentpatch = "true".equals(System
|
if ("true".equals(System.getProperty("silentpatch")))
|
||||||
.getProperty("silentpatch"));
|
options[QUIET].doesOccur = true;
|
||||||
|
|
||||||
System.out.println("nogui=" + nogui);
|
|
||||||
System.out.println("discoveryonly=" + discoveronly);
|
|
||||||
System.out.println("silentpatch=" + silentpatch);
|
|
||||||
|
|
||||||
|
// parse the arguments using UOption.parseArgs
|
||||||
int argsleft = UOption.parseArgs(args, options);
|
int argsleft = UOption.parseArgs(args, options);
|
||||||
|
|
||||||
|
// if help is specified, show the help specs and do nothing else
|
||||||
if (options[HELP].doesOccur) {
|
if (options[HELP].doesOccur) {
|
||||||
showHelp();
|
showHelp();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure only there is only one update mode in the options
|
||||||
int choiceType = (options[OFFLINE].doesOccur ? 1 : 0)
|
int choiceType = (options[OFFLINE].doesOccur ? 1 : 0)
|
||||||
+ (options[TZVERSION].doesOccur ? 1 : 0)
|
+ (options[TZVERSION].doesOccur ? 1 : 0)
|
||||||
+ (options[BEST].doesOccur ? 1 : 0);
|
+ (options[BEST].doesOccur ? 1 : 0)
|
||||||
|
+ (options[DISCOVERONLY].doesOccur ? 1 : 0);
|
||||||
if (choiceType > 1)
|
if (choiceType > 1)
|
||||||
syntaxError("Options -o (--offline), -t (--tzversion), and -b (--best) are mutually exclusive");// error
|
syntaxError("Options -o (--offline), -t (--tzversion), -b (--best) and -d (--discoveronly) are mutually exclusive");// error
|
||||||
|
|
||||||
|
// make sure that quiet & verbose do not both occur
|
||||||
if (options[QUIET].doesOccur && options[VERBOSE].doesOccur)
|
if (options[QUIET].doesOccur && options[VERBOSE].doesOccur)
|
||||||
syntaxError("Options -q (--quiet) and -v (--verbose) are mutually exclusive");// error
|
syntaxError("Options -q (--quiet) and -v (--verbose) are mutually exclusive");// error
|
||||||
|
|
||||||
|
// make sure that exactly one of backup & nobackup occurs
|
||||||
if (options[BACKUP].doesOccur && options[NOBACKUP].doesOccur)
|
if (options[BACKUP].doesOccur && options[NOBACKUP].doesOccur)
|
||||||
syntaxError("Options -b (--backup) and -B (--nobackup) are mutually exclusive");// error
|
syntaxError("Options -b (--backup) and -B (--nobackup) are mutually exclusive");// error
|
||||||
if (!options[BACKUP].doesOccur && !options[NOBACKUP].doesOccur)
|
if (!options[BACKUP].doesOccur && !options[NOBACKUP].doesOccur)
|
||||||
@ -51,22 +56,29 @@ public class CLILoader {
|
|||||||
if (argsleft != 0)
|
if (argsleft != 0)
|
||||||
syntaxError("Too many arguments");// error
|
syntaxError("Too many arguments");// error
|
||||||
|
|
||||||
if (options[QUIET].doesOccur) // quiet implies auto
|
// quiet implies auto
|
||||||
|
if (options[QUIET].doesOccur)
|
||||||
options[AUTO].doesOccur = true;
|
options[AUTO].doesOccur = true;
|
||||||
if (options[AUTO].doesOccur && choiceType == 0) // auto implies best
|
|
||||||
// by default
|
// auto implies best if no preference specified
|
||||||
{
|
if (options[AUTO].doesOccur && choiceType == 0) {
|
||||||
options[BEST].doesOccur = true;
|
options[BEST].doesOccur = true;
|
||||||
choiceType = 1;
|
choiceType = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the backup dir from the options
|
||||||
if (options[BACKUP].doesOccur)
|
if (options[BACKUP].doesOccur)
|
||||||
backupDir = new File(options[BACKUP].value);
|
backupDir = new File(options[BACKUP].value);
|
||||||
|
|
||||||
|
// if the user did not specify to stay offline, go online and find
|
||||||
|
// zoneinfo.res files
|
||||||
if (!options[OFFLINE].doesOccur)
|
if (!options[OFFLINE].doesOccur)
|
||||||
sourceModel.findSources();
|
sourceModel.findSources();
|
||||||
|
|
||||||
|
// load paths from the directory search file
|
||||||
pathModel.loadPaths();
|
pathModel.loadPaths();
|
||||||
|
|
||||||
|
// search the paths for updatable icu4j files
|
||||||
try {
|
try {
|
||||||
System.out.println("Search started.");
|
System.out.println("Search started.");
|
||||||
pathModel.searchAll(options[RECURSE].doesOccur, backupDir);
|
pathModel.searchAll(options[RECURSE].doesOccur, backupDir);
|
||||||
@ -75,20 +87,31 @@ public class CLILoader {
|
|||||||
System.out.println("Search interrupted.");
|
System.out.println("Search interrupted.");
|
||||||
}
|
}
|
||||||
|
|
||||||
String chosenString = (options[BEST].doesOccur) ? getBestString()
|
// get the name and url associated with the update mode (or null if
|
||||||
: (options[OFFLINE].doesOccur) ? getLocalString()
|
// unspecified)
|
||||||
: (options[TZVERSION].doesOccur) ? getTZVersionString(options[TZVERSION].value)
|
String chosenName = null;
|
||||||
: null;
|
String chosenVersion = null;
|
||||||
|
URL chosenURL = null;
|
||||||
URL chosenURL = (options[BEST].doesOccur) ? getBestURL()
|
if (options[BEST].doesOccur) {
|
||||||
: (options[OFFLINE].doesOccur) ? getLocalURL()
|
chosenName = getBestName();
|
||||||
: (options[TZVERSION].doesOccur) ? getTZVersionURL(options[TZVERSION].value)
|
chosenVersion = getBestVersion();
|
||||||
: null;
|
chosenURL = getBestURL();
|
||||||
|
} else if (options[OFFLINE].doesOccur) {
|
||||||
|
chosenName = getLocalName();
|
||||||
|
chosenVersion = getLocalVersion();
|
||||||
|
chosenURL = getLocalURL();
|
||||||
|
} else if (options[TZVERSION].doesOccur) {
|
||||||
|
chosenName = getTZVersionName(options[TZVERSION].value);
|
||||||
|
chosenVersion = getTZVersionVersion(options[TZVERSION].value);
|
||||||
|
chosenURL = getTZVersionURL(options[TZVERSION].value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// create a reader for user input
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||||
System.in));
|
System.in));
|
||||||
Iterator resultIter = resultModel.iterator();
|
|
||||||
|
|
||||||
|
// iterate through each icu4j file in the search results
|
||||||
|
Iterator resultIter = resultModel.iterator();
|
||||||
while (resultIter.hasNext()) {
|
while (resultIter.hasNext()) {
|
||||||
try {
|
try {
|
||||||
ICUFile entry = (ICUFile) resultIter.next();
|
ICUFile entry = (ICUFile) resultIter.next();
|
||||||
@ -109,13 +132,14 @@ public class CLILoader {
|
|||||||
|
|
||||||
if (options[AUTO].doesOccur) // automatic mode
|
if (options[AUTO].doesOccur) // automatic mode
|
||||||
{
|
{
|
||||||
update(entry, chosenString, chosenURL);
|
update(entry, chosenName, chosenURL);
|
||||||
} else if (choiceType == 1) // confirmation mode
|
} else if (choiceType == 1) // confirmation mode
|
||||||
{
|
{
|
||||||
String input = askConfirm(chosenString, reader);
|
String input = askConfirm(chosenName, chosenVersion,
|
||||||
|
entry.getTZVersion(), reader);
|
||||||
|
|
||||||
if ("yes".startsWith(input))
|
if ("yes".startsWith(input))
|
||||||
update(entry, chosenString, chosenURL);
|
update(entry, chosenName, chosenURL);
|
||||||
else
|
else
|
||||||
skipUpdate();
|
skipUpdate();
|
||||||
} else // interactive mode
|
} else // interactive mode
|
||||||
@ -123,11 +147,11 @@ public class CLILoader {
|
|||||||
String input = askChoice(reader);
|
String input = askChoice(reader);
|
||||||
|
|
||||||
if ("best".startsWith(input))
|
if ("best".startsWith(input))
|
||||||
update(entry, getBestString(), getBestURL());
|
update(entry, getBestName(), getBestURL());
|
||||||
else if (!"local choice".startsWith(input))
|
else if ("local choice".startsWith(input))
|
||||||
update(entry, getLocalString(), getLocalURL());
|
update(entry, getLocalName(), getLocalURL());
|
||||||
else if (!"none".startsWith(input))
|
else if (!"none".startsWith(input))
|
||||||
update(entry, getTZVersionString(input),
|
update(entry, getTZVersionName(input),
|
||||||
getTZVersionURL(input));
|
getTZVersionURL(input));
|
||||||
else
|
else
|
||||||
skipUpdate();
|
skipUpdate();
|
||||||
@ -146,11 +170,21 @@ public class CLILoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String askConfirm(String chosenString, BufferedReader reader)
|
private String askConfirm(String chosenString, String chosenVersion,
|
||||||
throws IOException {
|
String currentVersion, BufferedReader reader) throws IOException {
|
||||||
System.out.println("Update to " + chosenString
|
int betterness = 1; // chosenString.compareToIgnoreCase(currentVersion);
|
||||||
+ "? [yes (default), no]");
|
if (betterness == 0) {
|
||||||
System.out.print(": ");
|
System.out.println("Updating should have no effect on this file.");
|
||||||
|
System.out.print("Update anyway?");
|
||||||
|
} else if (betterness < 0) {
|
||||||
|
System.out
|
||||||
|
.println("Warning: The version specified is older than the one present in the file.");
|
||||||
|
System.out.print("Update anyway?");
|
||||||
|
} else {
|
||||||
|
System.out.print("Update to " + chosenVersion + "?");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.print(" [yes (default), no]\n: ");
|
||||||
return reader.readLine().trim().toLowerCase();
|
return reader.readLine().trim().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,6 +197,7 @@ public class CLILoader {
|
|||||||
while (sourceIter.hasNext())
|
while (sourceIter.hasNext())
|
||||||
System.out.print(", " + ((Map.Entry) sourceIter.next()).getKey());
|
System.out.print(", " + ((Map.Entry) sourceIter.next()).getKey());
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
System.out
|
System.out
|
||||||
.println("Update Version? [best (default), <specific version>, local copy, none]");
|
.println("Update Version? [best (default), <specific version>, local copy, none]");
|
||||||
System.out.print(": ");
|
System.out.print(": ");
|
||||||
@ -175,7 +210,7 @@ public class CLILoader {
|
|||||||
entry.updateJar(url, backupDir);
|
entry.updateJar(url, backupDir);
|
||||||
System.out.println("Update done.");
|
System.out.println("Update done.");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
System.out.println(ex);
|
System.err.println(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,20 +218,32 @@ public class CLILoader {
|
|||||||
System.out.println("Update skipped.");
|
System.out.println("Update skipped.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getBestString() {
|
private String getBestName() {
|
||||||
return (String) sourceModel.getSelectedItem();
|
return (String) sourceModel.getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLocalString() {
|
private String getLocalName() {
|
||||||
return SourceModel.TZ_LOCAL_CHOICE;
|
return SourceModel.TZ_LOCAL_CHOICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getTZVersionString(String version) {
|
private String getTZVersionName(String version) {
|
||||||
return version;
|
return version.trim().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getBestVersion() {
|
||||||
|
return sourceModel.getVersion(sourceModel.getSelectedItem());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getLocalVersion() {
|
||||||
|
return SourceModel.TZ_LOCAL_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getTZVersionVersion(String version) {
|
||||||
|
return version.trim().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
private URL getBestURL() {
|
private URL getBestURL() {
|
||||||
return sourceModel.getValue(sourceModel.getSelectedItem());
|
return sourceModel.getURL(sourceModel.getSelectedItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
private URL getLocalURL() {
|
private URL getLocalURL() {
|
||||||
@ -229,9 +276,6 @@ public class CLILoader {
|
|||||||
|
|
||||||
private File backupDir = null;
|
private File backupDir = null;
|
||||||
|
|
||||||
// { pathModel.add(new ICUPath(new File("C:\\Documents and Settings\\Daniel
|
|
||||||
// Kesserich\\Desktop\\Spring 2007\\IBM\\updatehere"), true)); }
|
|
||||||
|
|
||||||
private static UOption options[] = new UOption[] {
|
private static UOption options[] = new UOption[] {
|
||||||
UOption.create("help", '?', UOption.NO_ARG),
|
UOption.create("help", '?', UOption.NO_ARG),
|
||||||
UOption.create("verbose", 'v', UOption.NO_ARG),
|
UOption.create("verbose", 'v', UOption.NO_ARG),
|
||||||
|
@ -6,18 +6,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.ibm.icu.dev.tool.tzu;
|
package com.ibm.icu.dev.tool.tzu;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.*;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.*;
|
|
||||||
import javax.swing.border.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import javax.swing.text.*;
|
|
||||||
import javax.swing.text.html.*;
|
|
||||||
import javax.swing.text.html.parser.*;
|
|
||||||
|
|
||||||
public class GUILoader {
|
public class GUILoader {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@ -231,7 +223,5 @@ public class GUILoader {
|
|||||||
|
|
||||||
private JFrame resultFrame;
|
private JFrame resultFrame;
|
||||||
|
|
||||||
private ICUJarFinder jarFinder;
|
|
||||||
|
|
||||||
private File backupDir;
|
private File backupDir;
|
||||||
}
|
}
|
@ -11,7 +11,6 @@ import java.util.jar.*;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import com.ibm.icu.util.*;
|
import com.ibm.icu.util.*;
|
||||||
import com.ibm.icu.impl.*;
|
|
||||||
|
|
||||||
public class ICUFile {
|
public class ICUFile {
|
||||||
public ICUFile(File file) throws IOException {
|
public ICUFile(File file) throws IOException {
|
||||||
@ -28,14 +27,6 @@ public class ICUFile {
|
|||||||
System.out.println("Added: " + file);
|
System.out.println("Added: " + file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReadable() {
|
|
||||||
return getFile().canRead();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isWritable() {
|
|
||||||
return getFile().canWrite();
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getFile() {
|
public File getFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@ -70,20 +61,18 @@ public class ICUFile {
|
|||||||
|
|
||||||
public void updateJar(URL insertURL, File backupDir) throws IOException {
|
public void updateJar(URL insertURL, File backupDir) throws IOException {
|
||||||
if (!file.canRead() || !file.canWrite())
|
if (!file.canRead() || !file.canWrite())
|
||||||
throw new JarException("Missing permissions for " + file);
|
throw new IOException("Missing permissions for " + file);
|
||||||
File backupFile = null;
|
File backupFile = null;
|
||||||
if ((backupFile = createBackupFile(file, backupDir)) == null)
|
if ((backupFile = createBackupFile(file, backupDir)) == null)
|
||||||
throw new JarException("Failed to create a backup file.");
|
throw new IOException("Failed to create a backup file.");
|
||||||
if (!copyFile(file, backupFile))
|
if (!copyFile(file, backupFile))
|
||||||
throw new JarException("Could not replace the original jar.");
|
throw new IOException("Could not replace the original jar.");
|
||||||
if (!createUpdatedJar(backupFile, file, insertEntry, insertURL))
|
if (!createUpdatedJar(backupFile, file, insertEntry, insertURL))
|
||||||
throw new IOException("Could not create an updated jar.");
|
throw new IOException("Could not create an updated jar.");
|
||||||
|
|
||||||
tzVersion = findEntryTZVersion(file, insertEntry);
|
tzVersion = findEntryTZVersion(file, insertEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////////////////////////////
|
|
||||||
|
|
||||||
private static File createBackupFile(File inputFile, File backupBase) {
|
private static File createBackupFile(File inputFile, File backupBase) {
|
||||||
String filename = inputFile.getName();
|
String filename = inputFile.getName();
|
||||||
String suffix = ".jar";
|
String suffix = ".jar";
|
||||||
@ -122,8 +111,8 @@ public class ICUFile {
|
|||||||
backupFile = null;
|
backupFile = null;
|
||||||
} finally {
|
} finally {
|
||||||
ostream.close();
|
ostream.close();
|
||||||
return backupFile;
|
|
||||||
}
|
}
|
||||||
|
return backupFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,8 +150,8 @@ public class ICUFile {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean copyEntry(File inputFile, JarEntry inputEntry,
|
private static boolean copyEntry(File inputFile, JarEntry inputEntry,
|
||||||
@ -208,8 +197,8 @@ public class ICUFile {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean createUpdatedJar(File inputFile, File outputFile,
|
private static boolean createUpdatedJar(File inputFile, File outputFile,
|
||||||
@ -284,8 +273,8 @@ public class ICUFile {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isUpdatable() {
|
private boolean isUpdatable() {
|
||||||
@ -301,8 +290,6 @@ public class ICUFile {
|
|||||||
Attributes attr = (Attributes) iter.next();
|
Attributes attr = (Attributes) iter.next();
|
||||||
icuTitle = attr
|
icuTitle = attr
|
||||||
.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
|
.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
|
||||||
icuVendor = attr
|
|
||||||
.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
|
|
||||||
icuVersion = attr
|
icuVersion = attr
|
||||||
.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
|
.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
|
||||||
if (!("ICU for Java".equals(icuTitle) || "Modularized ICU for Java"
|
if (!("ICU for Java".equals(icuTitle) || "Modularized ICU for Java"
|
||||||
@ -329,8 +316,8 @@ public class ICUFile {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +331,7 @@ public class ICUFile {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String findEntryTZVersion(File icuFile, JarEntry tzEntry) {
|
public static String findEntryTZVersion(File icuFile, JarEntry tzEntry) {
|
||||||
try {
|
try {
|
||||||
File temp = File.createTempFile("zoneinfo", ".res");
|
File temp = File.createTempFile("zoneinfo", ".res");
|
||||||
temp.deleteOnExit();
|
temp.deleteOnExit();
|
||||||
@ -368,6 +355,13 @@ public class ICUFile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* public static String findURLTZVersion(File tzFile) { try { File temp =
|
||||||
|
* File.createTempFile("zoneinfo", ".res"); temp.deleteOnExit();
|
||||||
|
* copyFile(tzFile, temp); return findTZVersion(temp); } catch (IOException
|
||||||
|
* ex) { ex.printStackTrace(); return null; } }
|
||||||
|
*/
|
||||||
|
|
||||||
private static String findTZVersion(File tzFile) {
|
private static String findTZVersion(File tzFile) {
|
||||||
try {
|
try {
|
||||||
String filename = tzFile.getName();
|
String filename = tzFile.getName();
|
||||||
@ -376,6 +370,7 @@ public class ICUFile {
|
|||||||
|
|
||||||
URL url = new URL(tzFile.getParentFile().toURL().toString());
|
URL url = new URL(tzFile.getParentFile().toURL().toString());
|
||||||
ClassLoader loader = new URLClassLoader(new URL[] { url });
|
ClassLoader loader = new URLClassLoader(new URL[] { url });
|
||||||
|
|
||||||
UResourceBundle bundle = UResourceBundle.getBundleInstance("",
|
UResourceBundle bundle = UResourceBundle.getBundleInstance("",
|
||||||
entryname, loader);
|
entryname, loader);
|
||||||
|
|
||||||
@ -388,8 +383,6 @@ public class ICUFile {
|
|||||||
// included
|
// included
|
||||||
} catch (MalformedURLException ex) {
|
} catch (MalformedURLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
} catch (IOException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return UNKNOWN_VERSION;
|
return UNKNOWN_VERSION;
|
||||||
@ -407,8 +400,6 @@ public class ICUFile {
|
|||||||
|
|
||||||
private JarEntry insertEntry;
|
private JarEntry insertEntry;
|
||||||
|
|
||||||
private String icuVendor;
|
|
||||||
|
|
||||||
private String icuTitle;
|
private String icuTitle;
|
||||||
|
|
||||||
private String icuVersion;
|
private String icuVersion;
|
||||||
|
@ -29,6 +29,15 @@ public class ICUJarFinder {
|
|||||||
if (backupDir != null)
|
if (backupDir != null)
|
||||||
excluded.add(backupDir);
|
excluded.add(backupDir);
|
||||||
|
|
||||||
|
System.out.println("*************");
|
||||||
|
System.out.println("Included:");
|
||||||
|
for (int i = 0; i < included.size(); i++)
|
||||||
|
System.out.println(included.get(i));
|
||||||
|
System.out.println("Excluded:");
|
||||||
|
for (int i = 0; i < excluded.size(); i++)
|
||||||
|
System.out.println(excluded.get(i));
|
||||||
|
System.out.println("*************");
|
||||||
|
|
||||||
for (int i = 0; i < included.size(); i++)
|
for (int i = 0; i < included.size(); i++)
|
||||||
search(resultModel, (File) included.get(i), excluded, subdirs, true);
|
search(resultModel, (File) included.get(i), excluded, subdirs, true);
|
||||||
|
|
||||||
@ -37,11 +46,9 @@ public class ICUJarFinder {
|
|||||||
private static void search(ResultModel resultModel, File file,
|
private static void search(ResultModel resultModel, File file,
|
||||||
List excluded, boolean subdirs, boolean firstdip)
|
List excluded, boolean subdirs, boolean firstdip)
|
||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
List result = new ArrayList();
|
|
||||||
|
|
||||||
Iterator iter = excluded.iterator();
|
Iterator iter = excluded.iterator();
|
||||||
while (iter.hasNext())
|
while (iter.hasNext())
|
||||||
if (file.getAbsolutePath().equals(
|
if (file.getAbsolutePath().equalsIgnoreCase(
|
||||||
((File) iter.next()).getAbsolutePath()))
|
((File) iter.next()).getAbsolutePath()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -6,22 +6,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.ibm.icu.dev.tool.tzu;
|
package com.ibm.icu.dev.tool.tzu;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.*;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.*;
|
|
||||||
import javax.swing.border.*;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.*;
|
|
||||||
import javax.swing.text.*;
|
|
||||||
import javax.swing.text.html.*;
|
|
||||||
import javax.swing.text.html.parser.*;
|
|
||||||
|
|
||||||
public class PathComponent extends JComponent {
|
public class PathComponent extends JComponent {
|
||||||
public PathComponent(final GUILoader owner, final PathModel pathModel) {
|
public PathComponent(final GUILoader owner, final PathModel pathModel) {
|
||||||
this.owner = owner;
|
|
||||||
this.pathModel = pathModel;
|
this.pathModel = pathModel;
|
||||||
|
|
||||||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
||||||
@ -157,11 +148,9 @@ public class PathComponent extends JComponent {
|
|||||||
pathSearchButton.setEnabled(value);
|
pathSearchButton.setEnabled(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private GUILoader owner;
|
|
||||||
|
|
||||||
private JPanel pathInputPanel = new JPanel();
|
private JPanel pathInputPanel = new JPanel();
|
||||||
|
|
||||||
private JPanel pathListPanel = new JPanel();
|
// private JPanel pathListPanel = new JPanel();
|
||||||
|
|
||||||
private JPanel pathOptionPanel = new JPanel();
|
private JPanel pathOptionPanel = new JPanel();
|
||||||
|
|
||||||
@ -199,4 +188,6 @@ public class PathComponent extends JComponent {
|
|||||||
private JMenuItem pathSearchAllItem = new JMenuItem("Search All");
|
private JMenuItem pathSearchAllItem = new JMenuItem("Search All");
|
||||||
|
|
||||||
private PathModel pathModel;
|
private PathModel pathModel;
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1340;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ class PathModel extends AbstractListModel {
|
|||||||
|
|
||||||
public void loadPaths() {
|
public void loadPaths() {
|
||||||
BufferedReader reader = null;
|
BufferedReader reader = null;
|
||||||
String buffer;
|
|
||||||
int lineNumber = 1;
|
int lineNumber = 1;
|
||||||
String line;
|
String line;
|
||||||
char sign;
|
char sign;
|
||||||
@ -42,7 +41,7 @@ class PathModel extends AbstractListModel {
|
|||||||
if (line.length() >= 1) {
|
if (line.length() >= 1) {
|
||||||
sign = line.charAt(0);
|
sign = line.charAt(0);
|
||||||
if (sign != '#') {
|
if (sign != '#') {
|
||||||
if (sign != '+' && sign != '-')
|
if (sign != '+' && sign != '-' && !"all".equals(line))
|
||||||
pathlistError(
|
pathlistError(
|
||||||
"Each path entry must start with a + or - to denote inclusion/exclusion",
|
"Each path entry must start with a + or - to denote inclusion/exclusion",
|
||||||
lineNumber);// error
|
lineNumber);// error
|
||||||
@ -168,4 +167,6 @@ class PathModel extends AbstractListModel {
|
|||||||
private ResultModel resultModel = null;
|
private ResultModel resultModel = null;
|
||||||
|
|
||||||
public static final String PATHLIST_FILENAME = "DirectorySearch.txt";
|
public static final String PATHLIST_FILENAME = "DirectorySearch.txt";
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1337;
|
||||||
}
|
}
|
@ -6,11 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.ibm.icu.dev.tool.tzu;
|
package com.ibm.icu.dev.tool.tzu;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.*;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.*;
|
|
||||||
import javax.swing.border.*;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -19,7 +15,6 @@ import java.net.*;
|
|||||||
public class ResultComponent extends JComponent {
|
public class ResultComponent extends JComponent {
|
||||||
public ResultComponent(final GUILoader owner,
|
public ResultComponent(final GUILoader owner,
|
||||||
final ResultModel resultModel, final SourceModel sourceModel) {
|
final ResultModel resultModel, final SourceModel sourceModel) {
|
||||||
this.owner = owner;
|
|
||||||
this.resultModel = resultModel;
|
this.resultModel = resultModel;
|
||||||
this.sourceModel = sourceModel;
|
this.sourceModel = sourceModel;
|
||||||
|
|
||||||
@ -167,7 +162,7 @@ public class ResultComponent extends JComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private URL getSelectedSource() {
|
private URL getSelectedSource() {
|
||||||
return sourceModel.getValue(resultSourceList.getSelectedItem());
|
return sourceModel.getURL(resultSourceList.getSelectedItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean addFile(File file) {
|
private boolean addFile(File file) {
|
||||||
@ -193,11 +188,9 @@ public class ResultComponent extends JComponent {
|
|||||||
resultCancelUpdateButton.setEnabled(value);
|
resultCancelUpdateButton.setEnabled(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private GUILoader owner;
|
|
||||||
|
|
||||||
private JPanel resultInputPanel = new JPanel();
|
private JPanel resultInputPanel = new JPanel();
|
||||||
|
|
||||||
private JPanel resultTablePanel = new JPanel();
|
// private JPanel resultTablePanel = new JPanel();
|
||||||
|
|
||||||
private JPanel resultOptionPanel = new JPanel();
|
private JPanel resultOptionPanel = new JPanel();
|
||||||
|
|
||||||
@ -238,4 +231,5 @@ public class ResultComponent extends JComponent {
|
|||||||
|
|
||||||
private SourceModel sourceModel;
|
private SourceModel sourceModel;
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1341;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,8 @@ class ResultModel extends AbstractTableModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(ICUFile entry) {
|
public void add(ICUFile entry) {
|
||||||
if (entry.isReadable() && entry.isWritable())
|
File file = entry.getFile();
|
||||||
|
if (file.canRead() && file.canWrite())
|
||||||
add(permissibleList, hidden, entry);
|
add(permissibleList, hidden, entry);
|
||||||
|
|
||||||
add(completeList, !hidden, entry);
|
add(completeList, !hidden, entry);
|
||||||
@ -109,8 +110,6 @@ class ResultModel extends AbstractTableModel {
|
|||||||
updateAll(completeList, updateURL, backupDir);
|
updateAll(completeList, updateURL, backupDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ///////////////////////////
|
|
||||||
|
|
||||||
private void add(List list, boolean fire, ICUFile entry) {
|
private void add(List list, boolean fire, ICUFile entry) {
|
||||||
remove(list, fire, entry.getFile());
|
remove(list, fire, entry.getFile());
|
||||||
list.add(entry);
|
list.add(entry);
|
||||||
@ -218,4 +217,6 @@ class ResultModel extends AbstractTableModel {
|
|||||||
private List permissibleList = new ArrayList();
|
private List permissibleList = new ArrayList();
|
||||||
|
|
||||||
private boolean hidden = true;
|
private boolean hidden = true;
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1338;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.ibm.icu.dev.tool.tzu;
|
package com.ibm.icu.dev.tool.tzu;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -16,13 +15,8 @@ import javax.swing.text.html.*;
|
|||||||
import javax.swing.text.html.parser.*;
|
import javax.swing.text.html.parser.*;
|
||||||
|
|
||||||
class SourceModel extends AbstractListModel implements ComboBoxModel {
|
class SourceModel extends AbstractListModel implements ComboBoxModel {
|
||||||
public SourceModel() {
|
|
||||||
// map.put(TZ_LOCAL_CHOICE, TZ_LOCAL_URL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void findSources() {
|
public void findSources() {
|
||||||
BufferedReader reader = null;
|
BufferedReader reader = null;
|
||||||
final Thread t = Thread.currentThread();
|
|
||||||
try {
|
try {
|
||||||
reader = new BufferedReader(new InputStreamReader(TZ_BASE_URL
|
reader = new BufferedReader(new InputStreamReader(TZ_BASE_URL
|
||||||
.openStream()));
|
.openStream()));
|
||||||
@ -47,14 +41,14 @@ class SourceModel extends AbstractListModel implements ComboBoxModel {
|
|||||||
if (!"..".equals(str))
|
if (!"..".equals(str))
|
||||||
try {
|
try {
|
||||||
// add the new item to the map
|
// add the new item to the map
|
||||||
map.put(str, new URL(TZ_BASE_URLSTRING_START
|
urlMap.put(str, new URL(TZ_BASE_URLSTRING_START
|
||||||
+ str + TZ_BASE_URLSTRING_END));
|
+ str + TZ_BASE_URLSTRING_END));
|
||||||
|
|
||||||
// update the selected item and fire off an
|
// update the selected item and fire off an
|
||||||
// event
|
// event
|
||||||
selected = (String) map.lastKey();
|
selected = (String) urlMap.lastKey();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (Iterator iter = map.keySet().iterator(); iter
|
for (Iterator iter = urlMap.keySet().iterator(); iter
|
||||||
.hasNext();) {
|
.hasNext();) {
|
||||||
if (iter.next().equals(str))
|
if (iter.next().equals(str))
|
||||||
index++;
|
index++;
|
||||||
@ -84,31 +78,43 @@ class SourceModel extends AbstractListModel implements ComboBoxModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Iterator iterator() {
|
public Iterator iterator() {
|
||||||
return map.entrySet().iterator();
|
return urlMap.entrySet().iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return map.size() + 1; // the added size is due to the local copy not
|
// the added size (+1) is due to the local copy not being inside the map
|
||||||
// being inside the map
|
return urlMap.size() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getElementAt(int index) {
|
public Object getElementAt(int index) {
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
return TZ_LOCAL_CHOICE;
|
return TZ_LOCAL_CHOICE;
|
||||||
else if (index < 0 || index > map.size())
|
else if (index < 0 || index > urlMap.size())
|
||||||
return null;
|
return null;
|
||||||
else {
|
else {
|
||||||
Iterator iter = map.keySet().iterator();
|
Iterator iter = urlMap.keySet().iterator();
|
||||||
for (int i = 1; i < index; i++)
|
for (int i = 1; i < index; i++)
|
||||||
iter.next();
|
iter.next();
|
||||||
return iter.next();
|
return iter.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public URL getValue(Object choice) {
|
public URL getURL(Object choice) {
|
||||||
return (choice == null) ? null
|
if (choice == null || !(choice instanceof String))
|
||||||
: (((String) choice).toLowerCase() == TZ_LOCAL_CHOICE
|
return null;
|
||||||
.toLowerCase()) ? TZ_LOCAL_URL : (URL) map.get(choice);
|
else if (TZ_LOCAL_CHOICE.equalsIgnoreCase((String) choice))
|
||||||
|
return TZ_LOCAL_URL;
|
||||||
|
else
|
||||||
|
return (URL) urlMap.get(choice);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion(Object choice) {
|
||||||
|
if (choice == null || !(choice instanceof String))
|
||||||
|
return null;
|
||||||
|
else if (TZ_LOCAL_CHOICE.equalsIgnoreCase((String) choice))
|
||||||
|
return TZ_LOCAL_VERSION;
|
||||||
|
else
|
||||||
|
return (String) choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getSelectedItem() {
|
public Object getSelectedItem() {
|
||||||
@ -121,7 +127,7 @@ class SourceModel extends AbstractListModel implements ComboBoxModel {
|
|||||||
|
|
||||||
private Object selected = TZ_LOCAL_CHOICE;
|
private Object selected = TZ_LOCAL_CHOICE;
|
||||||
|
|
||||||
private TreeMap map = new TreeMap();
|
private TreeMap urlMap = new TreeMap();
|
||||||
|
|
||||||
public static final String TZ_LOCAL_CHOICE = "Local Copy";
|
public static final String TZ_LOCAL_CHOICE = "Local Copy";
|
||||||
|
|
||||||
@ -129,16 +135,25 @@ class SourceModel extends AbstractListModel implements ComboBoxModel {
|
|||||||
|
|
||||||
public static final String TZ_BASE_URLSTRING_END = "/be/zoneinfo.res";
|
public static final String TZ_BASE_URLSTRING_END = "/be/zoneinfo.res";
|
||||||
|
|
||||||
|
public static final File TZ_LOCAL_FILE = new File("zoneinfo.res");
|
||||||
|
|
||||||
|
public static String TZ_LOCAL_VERSION = null;
|
||||||
|
|
||||||
public static URL TZ_BASE_URL = null;
|
public static URL TZ_BASE_URL = null;
|
||||||
|
|
||||||
public static URL TZ_LOCAL_URL = null;
|
public static URL TZ_LOCAL_URL = null;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
// cannot make TZ_BASE_URL and TZ_LOCAL_URL final since url creations
|
||||||
|
// need to be try-catched
|
||||||
try {
|
try {
|
||||||
TZ_BASE_URL = new URL(TZ_BASE_URLSTRING_START);
|
TZ_BASE_URL = new URL(TZ_BASE_URLSTRING_START);
|
||||||
TZ_LOCAL_URL = new File("zoneinfo.res").toURL();
|
TZ_LOCAL_URL = TZ_LOCAL_FILE.toURL();
|
||||||
|
TZ_LOCAL_VERSION = "tobefixed"; // ICUFile.findFileTZVersion(TZ_LOCAL_FILE);
|
||||||
} catch (MalformedURLException ex) {
|
} catch (MalformedURLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final long serialVersionUID = 1339;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
@ECHO OFF
|
@echo off
|
||||||
@echo *********** Welcome to the ICU4J Time Zone Update Utility (ICUTZU) ***********
|
|
||||||
|
|
||||||
rem /*
|
rem /*
|
||||||
rem *******************************************************************************
|
rem *******************************************************************************
|
||||||
rem * Copyright (C) 2007, International Business Machines Corporation and *
|
rem * Copyright (C) 2007, International Business Machines Corporation and *
|
||||||
@ -8,15 +6,35 @@ rem * others. All Rights Reserved.
|
|||||||
rem *******************************************************************************
|
rem *******************************************************************************
|
||||||
rem */
|
rem */
|
||||||
|
|
||||||
|
@echo *********** Welcome to the ICU4J Time Zone Update Utility (ICUTZU) ***********
|
||||||
|
|
||||||
rem set ICUTZU_HOME to the current directory
|
rem Set ICUTZU_HOME to the current directory.
|
||||||
set ICUTZU_HOME=%~dp0
|
set ICUTZU_HOME=%~dp0
|
||||||
@echo ICUTZU Home: %ICUTZU_HOME%
|
@echo ICUTZU Home: %ICUTZU_HOME%
|
||||||
|
|
||||||
|
rem Make sure certain files are present.
|
||||||
IF NOT EXIST "%ICUTZU_HOME%icutzu.jar" GOTO MissingICUTZUJAR
|
IF NOT EXIST "%ICUTZU_HOME%icutzu.jar" GOTO MissingICUTZUJAR
|
||||||
IF NOT EXIST "%ICUTZU_HOME%icu4j.jar" GOTO MissingICU4JJAR
|
IF NOT EXIST "%ICUTZU_HOME%icu4j.jar" GOTO MissingICU4JJAR
|
||||||
Goto ICUTZUENV
|
IF NOT EXIST "%ICUTZU_HOME%runicutzuenv.bat" GOTO MissingICUTZUENV
|
||||||
|
|
||||||
|
rem Set environmental variables.
|
||||||
|
call "%ICUTZU_HOME%runicutzuenv.bat"
|
||||||
|
rem Double-check that JAVA_HOME is set.
|
||||||
|
@echo Java Home: %JAVA_HOME%
|
||||||
|
|
||||||
|
IF EXIST "%ICUTZU_HOME%\Temp" GOTO Next
|
||||||
|
rem Create a temporary directory.
|
||||||
|
mkdir "%ICUTZU_HOME%\Temp"
|
||||||
|
:Next
|
||||||
|
|
||||||
|
rem Run the ICUTZU tool.
|
||||||
|
@echo Launching the ICU4J Time Zone Update Utility (ICUTZU) ...
|
||||||
|
@echo "%JAVA_HOME%\bin\java.exe" -cp "%ICUTZU_HOME%icu4j.jar";"%ICUTZU_HOME%icutzu.jar" -Dnogui=%NOGUI% -Ddiscoveronly=%DISCOVERONLY% -Dsilentpatch=%SILENTPATCH% com.ibm.icu.dev.tool.tzu.ICUTZUMain --recurse --backup "%ICUTZU_HOME%Temp"
|
||||||
|
"%JAVA_HOME%\bin\java.exe" -cp "%ICUTZU_HOME%icu4j.jar";"%ICUTZU_HOME%icutzu.jar" -Dnogui=%NOGUI% -Ddiscoveronly=%DISCOVERONLY% -Dsilentpatch=%SILENTPATCH% com.ibm.icu.dev.tool.tzu.ICUTZUMain --recurse --backup "%ICUTZU_HOME%Temp"
|
||||||
|
|
||||||
|
GOTO Exit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:MissingICUTZUJAR
|
:MissingICUTZUJAR
|
||||||
@echo The ICU4J Time Zone Update Utility (icutzu.jar) doesn't exist in %ICUTZU_HOME%.
|
@echo The ICU4J Time Zone Update Utility (icutzu.jar) doesn't exist in %ICUTZU_HOME%.
|
||||||
@ -27,30 +45,11 @@ GOTO Exit
|
|||||||
@echo ICU for Java (icu4j.jar) doesn't exist in %ICUTZU_HOME%.
|
@echo ICU for Java (icu4j.jar) doesn't exist in %ICUTZU_HOME%.
|
||||||
GOTO Exit
|
GOTO Exit
|
||||||
|
|
||||||
:ICUTZUENV
|
|
||||||
rem set JAVA_HOME to the Java installation directory
|
|
||||||
IF NOT EXIST "%ICUTZU_HOME%runicutzuenv.bat" GOTO MissingICUTZUENV
|
|
||||||
call "%ICUTZU_HOME%runicutzuenv.bat"
|
|
||||||
@echo Java Home: %JAVA_HOME%
|
|
||||||
GOTO Temp
|
|
||||||
|
|
||||||
:MissingICUTZUENV
|
:MissingICUTZUENV
|
||||||
@echo runjtzuenv.bat file doesn't exist in %ICUTZU_HOME%.
|
@echo runjtzuenv.bat file doesn't exist in %ICUTZU_HOME%.
|
||||||
GOTO Exit
|
GOTO Exit
|
||||||
|
|
||||||
:Temp
|
|
||||||
IF EXIST "%ICUTZU_HOME%\Temp" GOTO Next
|
|
||||||
|
|
||||||
rem Create a temporary directory
|
|
||||||
mkdir "%ICUTZU_HOME%\Temp"
|
|
||||||
|
|
||||||
:Next
|
|
||||||
rem Run the ICUTZU tool
|
|
||||||
@echo Launching the ICU4J Time Zone Update Utility (ICUTZU) ...
|
|
||||||
|
|
||||||
@echo "%JAVA_HOME%\bin\java.exe" -cp "%ICUTZU_HOME%icu4j.jar";"%ICUTZU_HOME%icutzu.jar" -Dnogui=%NOGUI% -Ddiscoveronly=%DISCOVERONLY% -Dsilentpatch=%SILENTPATCH% com.ibm.icu.dev.tool.tzu.ICUCLI --backup "%ICUTZU_HOME%\Temp"
|
|
||||||
"%JAVA_HOME%\bin\java.exe" -cp "%ICUTZU_HOME%icu4j.jar";"%ICUTZU_HOME%icutzu.jar" -Dnogui=%NOGUI% -Ddiscoveronly=%DISCOVERONLY% -Dsilentpatch=%SILENTPATCH% com.ibm.icu.dev.tool.tzu.ICUCLI --backup "%ICUTZU_HOME%\Temp"
|
|
||||||
|
|
||||||
:Exit
|
:Exit
|
||||||
@echo End of ICU4J Time Zone Update Utility (ICUTZU).
|
@echo End of ICU4J Time Zone Update Utility (ICUTZU).
|
||||||
|
|
||||||
|
@ -5,14 +5,14 @@ rem * others. All Rights Reserved.
|
|||||||
rem *******************************************************************************
|
rem *******************************************************************************
|
||||||
rem */
|
rem */
|
||||||
|
|
||||||
rem set JAVA_HOME to the a Java installation directory
|
rem Set JAVA_HOME to the Java installation directory.
|
||||||
set JAVA_HOME=C:\Program Files\Java\jre1.6.0
|
set JAVA_HOME=C:\Program Files\Java\jre1.6.0
|
||||||
|
|
||||||
rem set NOGUI
|
rem Set whether the GUI will be run or not.
|
||||||
set NOGUI=true
|
set NOGUI=true
|
||||||
|
|
||||||
rem set DISCOVERONLY
|
rem Set whether the cmd-line utility will only discover update icu4j files.
|
||||||
set DISCOVERONLY=false
|
set DISCOVERONLY=false
|
||||||
|
|
||||||
rem set SILENTPATCH
|
rem Set whether the cmd-line utility will run silently.
|
||||||
set SILENTPATCH=false
|
set SILENTPATCH=false
|
||||||
|
Loading…
Reference in New Issue
Block a user