Changeset 372
- Timestamp:
- May 25, 2012, 4:00:54 PM (13 years ago)
- Location:
- trunk/icedtea-web/netx/net/sourceforge/jnlp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/icedtea-web/netx/net/sourceforge/jnlp/config/BasicValueValidators.java
r348 r372 40 40 import static net.sourceforge.jnlp.runtime.Translator.R; 41 41 42 import java.io.File; 42 43 import java.net.URL; 43 44 import java.util.Arrays; … … 102 103 103 104 String possibleFile = (String) possibleValue; 105 if (Defaults.OS_DOS_LIKE) { 106 if (!(Character.isLetter(possibleFile.charAt(0)) && 107 possibleFile.charAt(1) == ':' && 108 (possibleFile.charAt(2) == File.separatorChar || 109 possibleFile.charAt(2) == '/'))) { 110 throw new IllegalArgumentException(); 111 } 112 } 113 else 104 114 if (!(possibleFile.startsWith("/"))) { 105 115 throw new IllegalArgumentException(); … … 110 120 @Override 111 121 public String getPossibleValues() { 112 return R("VVPossibleFileValues");122 return Defaults.OS_DOS_LIKE ? R("VVPossibleFileValuesDOS") : R("VVPossibleFileValues"); 113 123 } 114 124 -
trunk/icedtea-web/netx/net/sourceforge/jnlp/config/Defaults.java
r348 r372 53 53 54 54 /** 55 * Whether the OS is a DOS-like (Windows, OS/2) or not. 56 */ 57 public static final boolean OS_DOS_LIKE = 58 System.getProperty("os.name").startsWith("OS/2") || 59 System.getProperty("os.name").contains("Windows"); 60 61 /** 55 62 * Get the default settings for deployment 56 63 */ -
trunk/icedtea-web/netx/net/sourceforge/jnlp/resources/Messages.properties
r348 r372 268 268 VVPossibleBooleanValues=are {0} or {1} 269 269 VVPossibleFileValues=include the absolute location of a file - it must begin with a / 270 VVPossibleFileValuesDOS=include the absolute location of a file - it must begin with a drive letter 270 271 VVPossibleRangedIntegerValues=are in range {0} to {1} (inclusive) 271 272 VVPossibleUrlValues=include any valid url (eg http://icedtea.classpath.org/hg/) -
trunk/icedtea-web/netx/net/sourceforge/jnlp/util/FileUtils.java
r348 r372 26 26 import java.nio.channels.FileLock; 27 27 28 import net.sourceforge.jnlp.config.Defaults; 28 29 import net.sourceforge.jnlp.runtime.JNLPRuntime; 29 30 … … 178 179 179 180 // remove all permissions 180 if (!tempFile.setExecutable(false, false)) { 181 throw new IOException(R("RRemoveXPermFailed", tempFile)); 182 } 183 if (!tempFile.setReadable(false, false)) { 184 throw new IOException(R("RRemoveRPermFailed", tempFile)); 181 if (!Defaults.OS_DOS_LIKE) { 182 if (!tempFile.setExecutable(false, false)) { 183 throw new IOException(R("RRemoveXPermFailed", tempFile)); 184 } 185 if (!tempFile.setReadable(false, false)) { 186 throw new IOException(R("RRemoveRPermFailed", tempFile)); 187 } 185 188 } 186 189 if (!tempFile.setWritable(false, false)) { … … 206 209 // opened the file right after it was created might still be able to 207 210 // read the data. 211 if (Defaults.OS_DOS_LIKE) { 212 // On OS/2 and Windows, renameTo() fails if the target exists 213 // so delete it first 214 file.delete(); 215 } 208 216 if (!tempFile.renameTo(file)) { 209 217 throw new IOException(R("RCantRename", tempFile, file));
Note:
See TracChangeset
for help on using the changeset viewer.