jdillon 2003/09/03 11:38:56
Modified:
modules/common/src/java/org/apache/geronimo/common/net/protocol/file
FileURLConnection.java
Log:
o commons-lang snap has been updated so remove hacks
Revision Changes Path
1.3 +3 -39
incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/net/protocol/file/FileURLConnection.java
Index: FileURLConnection.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/net/protocol/file/FileURLConnection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FileURLConnection.java 2 Sep 2003 07:43:01 -0000 1.2
+++ FileURLConnection.java 3 Sep 2003 18:38:56 -0000 1.3
@@ -81,10 +81,7 @@
import java.security.Permission;
-//
-// HACK: The current SNAPSHOT of commons-lang is old, inlined required
methods for now
-//
-// import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang.SystemUtils;
import org.apache.geronimo.common.NullArgumentException;
import org.apache.geronimo.common.Primitives;
@@ -205,34 +202,6 @@
return new FilePermission(filename, perms);
}
- //
- // HACK: The current SNAPSHOT of commons-lang is old, inlined required
methods for now
- //
-
- private static String getSystemProperty(String property) {
- try {
- return System.getProperty(property);
- } catch (SecurityException ex) {
- // we are not allowed to look at this property
- System.err.println(
- "Caught a SecurityException reading the system property '" +
property
- + "'; the SystemUtils property value will default to null."
- );
- return null;
- }
- }
-
- private static final String OS_NAME = getSystemProperty("os.name");
-
- private static boolean getOSMatches(String osNamePrefix) {
- if (OS_NAME == null) {
- return false;
- }
- return OS_NAME.startsWith(osNamePrefix);
- }
-
- private static final boolean IS_OS_WINDOWS = getOSMatches("Windows");
-
/**
* Conditionaly sync the underlying file descriptor if we are running
* on windows, so that the file details update.
@@ -240,12 +209,7 @@
private void maybeSync()
{
if (fd != null && fd.valid()) {
- //
- // HACK: The current SNAPSHOT of commons-lang is old,
- // inlined required methods for now
- //
-
- if (IS_OS_WINDOWS) {
+ if (SystemUtils.IS_OS_WINDOWS) {
try {
fd.sync();
}