src/solaris/classes/java/util/prefs/FileSystemPreferences.java
Print this page
@@ -108,17 +108,17 @@
if (!userRootDir.exists()) {
if (userRootDir.mkdirs()) {
try {
chmod(userRootDir.getCanonicalPath(), USER_RWX);
} catch (IOException e) {
- getLogger().warning("Could not change permissions" +
+ getLogger().fine("Could not change permissions" +
" on userRoot directory. ");
}
getLogger().info("Created user preferences directory.");
}
else
- getLogger().warning("Couldn't create user preferences" +
+ getLogger().fine("Couldn't create user preferences" +
" directory. User preferences are unusable.");
}
isUserRootWritable = userRootDir.canWrite();
String USER_NAME = System.getProperty("user.name");
userLockFile = new File (userRootDir,".user.lock." + USER_NAME);
@@ -130,16 +130,16 @@
userRootModFile.createNewFile();
// Only user can read/write userRootModFile.
int result = chmod(userRootModFile.getCanonicalPath(),
USER_READ_WRITE);
if (result !=0)
- getLogger().warning("Problem creating userRoot " +
+ getLogger().fine("Problem creating userRoot " +
"mod file. Chmod failed on " +
userRootModFile.getCanonicalPath() +
" Unix error code " + result);
} catch (IOException e) {
- getLogger().warning(e.toString());
+ getLogger().fine(e.toString());
}
userRootModTime = userRootModFile.lastModified();
return null;
}
});
@@ -182,11 +182,11 @@
chmod(systemRootDir.getCanonicalPath(),
USER_RWX_ALL_RX);
} catch (IOException e) {
}
} else {
- getLogger().warning("Could not create "
+ getLogger().fine("Could not create "
+ "system preferences directory. System "
+ "preferences are unusable.");
}
}
}
@@ -199,14 +199,14 @@
// create if does not exist.
systemRootModFile.createNewFile();
int result = chmod(systemRootModFile.getCanonicalPath(),
USER_RW_ALL_READ);
if (result !=0)
- getLogger().warning("Chmod failed on " +
+ getLogger().fine("Chmod failed on " +
systemRootModFile.getCanonicalPath() +
" Unix error code " + result);
- } catch (IOException e) { getLogger().warning(e.toString());
+ } catch (IOException e) { getLogger().fine(e.toString());
}
systemRootModTime = systemRootModFile.lastModified();
return null;
}
});
@@ -461,18 +461,18 @@
try {
if (userRt != null)
userRt.flush();
} catch(BackingStoreException e) {
- getLogger().warning("Couldn't flush user prefs: " + e);
+ getLogger().fine("Couldn't flush user prefs: " + e);
}
try {
if (systemRt != null)
systemRt.flush();
} catch(BackingStoreException e) {
- getLogger().warning("Couldn't flush system prefs: " + e);
+ getLogger().fine("Couldn't flush system prefs: " + e);
}
}
private final boolean isUserNode;
@@ -574,18 +574,18 @@
try (FileInputStream fis = new FileInputStream(prefsFile)) {
XmlSupport.importMap(fis, m);
}
} catch(Exception e) {
if (e instanceof InvalidPreferencesFormatException) {
- getLogger().warning("Invalid preferences format in "
+ getLogger().fine("Invalid preferences format in "
+ prefsFile.getPath());
prefsFile.renameTo( new File(
prefsFile.getParentFile(),
"IncorrectFormatPrefs.xml"));
m = new TreeMap<>();
} else if (e instanceof FileNotFoundException) {
- getLogger().warning("Prefs file removed in background "
+ getLogger().fine("Prefs file removed in background "
+ prefsFile.getPath());
} else {
throw new BackingStoreException(e);
}
}
@@ -695,11 +695,11 @@
prefsFile.delete();
tmpFile.delete();
// dir should be empty now. If it's not, empty it
File[] junk = dir.listFiles();
if (junk.length != 0) {
- getLogger().warning(
+ getLogger().fine(
"Found extraneous files when removing node: "
+ Arrays.asList(junk));
for (int i=0; i<junk.length; i++)
junk[i].delete();
}
@@ -926,20 +926,20 @@
return false;
}
/**
* Checks if unlockFile0() returned an error. Throws a SecurityException,
- * if access denied. Logs a warning otherwise.
+ * if access denied. Logs a FINE message otherwise.
*/
private void checkLockFile0ErrorCode (int errorCode)
throws SecurityException {
if (errorCode == EACCES)
throw new SecurityException("Could not lock " +
(isUserNode()? "User prefs." : "System prefs.") +
" Lock file access denied.");
if (errorCode != EAGAIN)
- getLogger().warning("Could not lock " +
+ getLogger().fine("Could not lock " +
(isUserNode()? "User prefs. " : "System prefs.") +
" Unix error code " + errorCode + ".");
}
/**
@@ -981,17 +981,17 @@
int result;
boolean usernode = isUserNode();
File lockFile = (usernode ? userLockFile : systemLockFile);
int lockHandle = ( usernode ? userRootLockHandle:systemRootLockHandle);
if (lockHandle == 0) {
- getLogger().warning("Unlock: zero lockHandle for " +
+ getLogger().fine("Unlock: zero lockHandle for " +
(usernode ? "user":"system") + " preferences.)");
return;
}
result = unlockFile0(lockHandle);
if (result != 0) {
- getLogger().warning("Could not drop file-lock on " +
+ getLogger().fine("Could not drop file-lock on " +
(isUserNode() ? "user" : "system") + " preferences." +
" Unix error code " + result + ".");
if (result == EACCES)
throw new SecurityException("Could not unlock" +
(isUserNode()? "User prefs." : "System prefs.") +