Author: manik.surtani(a)jboss.com
Date: 2008-02-05 13:59:35 -0500 (Tue, 05 Feb 2008)
New Revision: 5296
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
Log:
JBCACHE-1282 - reduce character limit warn message on newer windows systems
Modified: core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-02-05
18:14:08 UTC (rev 5295)
+++ core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-02-05
18:59:35 UTC (rev 5296)
@@ -78,7 +78,23 @@
* For fqn, check '*' '<' '>' '|'
'"' '?' and also '\' '/' and ':'
*/
public static final Pattern FQN_PATTERN =
Pattern.compile("[\\\\\\/:*<>|\"?]");
+ private static boolean isOldWindows;
+ public FileCacheLoader()
+ {
+ float osVersion = -1;
+ try
+ {
+ osVersion =
Float.parseFloat(System.getProperty("os.version").trim());
+ }
+ catch (Exception e)
+ {
+ // ignore
+ }
+ // 4.x is windows NT/2000 and 5.x is XP.
+ isOldWindows =
System.getProperty("os.name").toLowerCase().startsWith("windows")
&& osVersion < 4;
+ }
+
public void setConfig(IndividualCacheLoaderConfig base)
{
if (base instanceof FileCacheLoaderConfig)
@@ -473,9 +489,10 @@
protected boolean isLengthPortablePath(String absoluteFqnPath)
{
- if (absoluteFqnPath.length() > 255)
+
+ if (isOldWindows && absoluteFqnPath.length() > 255)
{
- log.warn("The full absolute path to the fqn that you are trying to store is
bigger than 255 characters, this could lead to problems in Windows systems: " +
absoluteFqnPath);
+ log.warn("The full absolute path to the fqn that you are trying to store is
bigger than 255 characters, this could lead to problems on certain Windows systems: "
+ absoluteFqnPath);
return false;
}