diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-28 17:25:02 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-28 17:25:02 +0000 |
commit | 62df4523890462ed7d49d0f151a6e4d520480cc2 (patch) | |
tree | c37c7c38baa5831c3115a630fcce968c5d473fbd /libjava | |
parent | 06c0831378adf9498978c86cd064d2aa54cf926f (diff) | |
download | gcc-62df4523890462ed7d49d0f151a6e4d520480cc2.tar.gz |
2005-04-28 Jeroen Frijters <jeroen@frijters.net>
* gnu/java/net/protocol/file/Connection.java
(StaticData): New inner class to contain statics.
(connect, getHeaderField): Modified to use StaticData.
2005-04-28 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/file/Connection.java
(lineSeparator): Initialize with SystemProperties.getProperty().
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98929 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/gnu/java/net/protocol/file/Connection.java | 36 |
2 files changed, 27 insertions, 20 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ec4edf1376c..ad2bc89060b 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2005-04-28 Jeroen Frijters <jeroen@frijters.net> + + * gnu/java/net/protocol/file/Connection.java + (StaticData): New inner class to contain statics. + (connect, getHeaderField): Modified to use StaticData. + +2005-04-28 Michael Koch <konqueror@gmx.de> + + * gnu/java/net/protocol/file/Connection.java + (lineSeparator): Initialize with SystemProperties.getProperty(). + 2005-04-27 Chris Burdess <dog@gnu.org> * gnu/java/net/protocol/file/Connection.java: Return correct content diff --git a/libjava/gnu/java/net/protocol/file/Connection.java b/libjava/gnu/java/net/protocol/file/Connection.java index 0f6e4d6f2b9..05611e24dff 100644 --- a/libjava/gnu/java/net/protocol/file/Connection.java +++ b/libjava/gnu/java/net/protocol/file/Connection.java @@ -37,7 +37,7 @@ exception statement from your version. */ package gnu.java.net.protocol.file; -import gnu.java.security.action.GetPropertyAction; +import gnu.classpath.SystemProperties; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -56,7 +56,6 @@ import java.net.ProtocolException; import java.net.URL; import java.net.URLConnection; import java.security.Permission; -import java.security.AccessController; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; @@ -76,23 +75,19 @@ public class Connection extends URLConnection */ private static final String DEFAULT_PERMISSION = "read"; - /** - * HTTP-style DateFormat, used to format the last-modified header. - */ - private static SimpleDateFormat dateFormat - = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss 'GMT'", - new Locale ("En", "Us", "Unix")); - - private static String lineSeparator; - - static + private static class StaticData { - if (lineSeparator == null) - { - GetPropertyAction getProperty = new GetPropertyAction("line.separator"); - lineSeparator = (String) AccessController.doPrivileged(getProperty); - } + /** + * HTTP-style DateFormat, used to format the last-modified header. + */ + static SimpleDateFormat dateFormat + = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss 'GMT'", + new Locale ("En", "Us", "Unix")); + + static String lineSeparator = + SystemProperties.getProperty("line.separator"); } + /** * This is a File object for this connection @@ -182,7 +177,7 @@ public class Connection extends URLConnection for (int i = 0; i < files.length; i++) { writer.write(files[i]); - writer.write(lineSeparator); + writer.write(StaticData.lineSeparator); } directoryListing = sink.toByteArray(); @@ -271,9 +266,10 @@ public class Connection extends URLConnection } else if (field.equals("last-modified")) { - synchronized (dateFormat) + synchronized (StaticData.dateFormat) { - return dateFormat.format(new Date(file.lastModified())); + return StaticData.dateFormat.format( + new Date(file.lastModified())); } } } |