natSystem.cc (init_properties): Revert yesterday's changes to "file.separator"...
* java/lang/natSystem.cc (init_properties): Revert yesterday's changes to "file.separator", "path.separator", and "java.io.tmpdir" property initialization. * java/io/File.java: Likewise. * java/io/natFile.cc (init_native): Likewise. * java/io/natFileWin32.cc (init_native): Likewise. From-SVN: r40994
This commit is contained in:
parent
a3406c06c2
commit
8f58baf480
5 changed files with 26 additions and 34 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2001-04-02 Bryce McKinlay <bryce@albatross.co.nz>
|
||||||
|
|
||||||
|
* java/lang/natSystem.cc (init_properties): Revert yesterday's changes
|
||||||
|
to "file.separator", "path.separator", and "java.io.tmpdir" property
|
||||||
|
initialization.
|
||||||
|
* java/io/File.java: Likewise.
|
||||||
|
* java/io/natFile.cc (init_native): Likewise.
|
||||||
|
* java/io/natFileWin32.cc (init_native): Likewise.
|
||||||
|
|
||||||
2001-04-01 Per Bothner <per@bothner.com>
|
2001-04-01 Per Bothner <per@bothner.com>
|
||||||
|
|
||||||
* java/lang/natString.cc (intern): If string's data does not point to
|
* java/lang/natString.cc (intern): If string's data does not point to
|
||||||
|
|
|
@ -195,11 +195,6 @@ public class File implements Serializable, Comparable
|
||||||
FileFilter fileFilter,
|
FileFilter fileFilter,
|
||||||
Class result_type);
|
Class result_type);
|
||||||
|
|
||||||
// Arguments for the performList function. Specifies whether we want
|
|
||||||
// File objects or path strings in the returned object array.
|
|
||||||
private final static int OBJECTS = 0;
|
|
||||||
private final static int STRINGS = 1;
|
|
||||||
|
|
||||||
public String[] list (FilenameFilter filter)
|
public String[] list (FilenameFilter filter)
|
||||||
{
|
{
|
||||||
checkRead();
|
checkRead();
|
||||||
|
@ -435,25 +430,23 @@ public class File implements Serializable, Comparable
|
||||||
return performSetLastModified(time);
|
return performSetLastModified(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String separator = null;
|
public static final String pathSeparator
|
||||||
public static final String pathSeparator = null;
|
= System.getProperty("path.separator");
|
||||||
static final String tmpdir = null;
|
public static final char pathSeparatorChar = pathSeparator.charAt(0);
|
||||||
|
public static final String separator = System.getProperty("file.separator");
|
||||||
|
public static final char separatorChar = separator.charAt(0);
|
||||||
|
|
||||||
|
static final String tmpdir = System.getProperty("java.io.tmpdir");
|
||||||
static int maxPathLen;
|
static int maxPathLen;
|
||||||
static boolean caseSensitive;
|
static boolean caseSensitive;
|
||||||
|
|
||||||
public static final char separatorChar;
|
|
||||||
public static final char pathSeparatorChar;
|
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
init_native();
|
init_native();
|
||||||
pathSeparatorChar = pathSeparator.charAt(0);
|
|
||||||
separatorChar = separator.charAt(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Native function called at class initialization. This should should
|
// Native function called at class initialization. This should should
|
||||||
// set the separator, pathSeparator, tmpdir, maxPathLen, and caseSensitive
|
// set the maxPathLen and caseSensitive variables.
|
||||||
// variables.
|
|
||||||
private static native void init_native();
|
private static native void init_native();
|
||||||
|
|
||||||
// The path.
|
// The path.
|
||||||
|
|
|
@ -338,13 +338,6 @@ java::io::File::performDelete (void)
|
||||||
void
|
void
|
||||||
java::io::File::init_native ()
|
java::io::File::init_native ()
|
||||||
{
|
{
|
||||||
separator = JvNewStringLatin1 ("/");
|
|
||||||
pathSeparator = JvNewStringLatin1 (":");
|
|
||||||
|
|
||||||
char *tmp = ::getenv("TMPDIR");
|
|
||||||
if (! tmp)
|
|
||||||
tmp = "/tmp";
|
|
||||||
tmpdir = JvNewStringLatin1 (tmp);
|
|
||||||
maxPathLen = MAXPATHLEN;
|
maxPathLen = MAXPATHLEN;
|
||||||
caseSensitive = true;
|
caseSensitive = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,9 +248,6 @@ java::io::File::performDelete ()
|
||||||
void
|
void
|
||||||
java::io::File::init_native ()
|
java::io::File::init_native ()
|
||||||
{
|
{
|
||||||
separator = JvNewStringLatin1 ("\\");
|
|
||||||
pathSeparator = JvNewStringLatin1 (";");
|
|
||||||
tmpdir = JvNewStringLatin1 ("C:\\temp"); // FIXME?
|
|
||||||
maxPathLen = MAX_PATH;
|
maxPathLen = MAX_PATH;
|
||||||
caseSensitive = false;
|
caseSensitive = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ details. */
|
||||||
#include <java/lang/StringBuffer.h>
|
#include <java/lang/StringBuffer.h>
|
||||||
#include <java/util/Properties.h>
|
#include <java/util/Properties.h>
|
||||||
#include <java/util/TimeZone.h>
|
#include <java/util/TimeZone.h>
|
||||||
#include <java/io/File.h>
|
|
||||||
#include <java/io/PrintStream.h>
|
#include <java/io/PrintStream.h>
|
||||||
#include <java/io/InputStream.h>
|
#include <java/io/InputStream.h>
|
||||||
|
|
||||||
|
@ -324,19 +323,20 @@ java::lang::System::init_properties (void)
|
||||||
|
|
||||||
SET ("file.encoding", default_file_encoding);
|
SET ("file.encoding", default_file_encoding);
|
||||||
|
|
||||||
JvInitClass (&java::io::File::class$);
|
|
||||||
newprops->put (JvNewStringLatin1 ("file.separator"),
|
|
||||||
java::io::File::separator);
|
|
||||||
newprops->put (JvNewStringLatin1 ("path.separator"),
|
|
||||||
java::io::File::pathSeparator);
|
|
||||||
newprops->put (JvNewStringLatin1 ("java.io.tmpdir"),
|
|
||||||
java::io::File::tmpdir);
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
SET ("file.separator", "\\");
|
||||||
|
SET ("path.separator", ";");
|
||||||
SET ("line.separator", "\r\n");
|
SET ("line.separator", "\r\n");
|
||||||
|
SET ("java.io.tmpdir", "C:\\temp");
|
||||||
#else
|
#else
|
||||||
// Unix.
|
// Unix.
|
||||||
|
SET ("file.separator", "/");
|
||||||
|
SET ("path.separator", ":");
|
||||||
SET ("line.separator", "\n");
|
SET ("line.separator", "\n");
|
||||||
|
char *tmpdir = ::getenv("TMPDIR");
|
||||||
|
if (! tmpdir)
|
||||||
|
tmpdir = "/tmp";
|
||||||
|
SET ("java.io.tmpdir", tmpdir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNAME
|
#ifdef HAVE_UNAME
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue