Revision 524
org.gvsig.jvmpreferences/trunk/org.gvsig.jvmpreferences.native/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.common/src/main/java/org/gvsig/jvmpreferences/nativeprefs/BaseMemoryPreferences.java | ||
---|---|---|
200 | 200 |
while ((line = reader.readLine())!=null) { |
201 | 201 |
if (!pattern.matcher(line).matches() || written) { |
202 | 202 |
writer.write(line); |
203 |
writer.newLine();
|
|
203 |
writer.write(getNewLineChars());
|
|
204 | 204 |
} |
205 | 205 |
else { |
206 | 206 |
written = true; // avoid writing the mem line twice |
207 | 207 |
writer.write(getEncodedMaxMemoryLine(maximumMemory)); |
208 |
writer.newLine();
|
|
208 |
writer.write(getNewLineChars());
|
|
209 | 209 |
} |
210 | 210 |
} |
211 | 211 |
} catch (FileNotFoundException e) { |
... | ... | |
261 | 261 |
*/ |
262 | 262 |
protected abstract String getEncodedMaxMemoryLine(int maximumMemory); |
263 | 263 |
|
264 |
/** |
|
265 |
* Gets the character(s) used as line separators. We don't use the "line.separator" |
|
266 |
* Java property because we currently must use the Unix-style separator even in Windows, |
|
267 |
* and this might change in the future. |
|
268 |
* @return |
|
269 |
*/ |
|
270 |
protected abstract String getNewLineChars(); |
|
271 |
|
|
264 | 272 |
public int getFactoryDefaultMaximum() { |
265 |
return FACTORY_DEFAULT_MAXIMUM;
|
|
266 |
}
|
|
273 |
return FACTORY_DEFAULT_MAXIMUM; |
|
274 |
} |
|
267 | 275 |
} |
org.gvsig.jvmpreferences/trunk/org.gvsig.jvmpreferences.native/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.windows/src/main/java/org/gvsig/jvmpreferences/nativeprefs/MemoryPreferencesWindows.java | ||
---|---|---|
90 | 90 |
//return "export GVSIG_MAX_MEM="+maximumMemory+"M"; |
91 | 91 |
return "GVSIG_MAX_MEM="+maximumMemory+"M"; |
92 | 92 |
} |
93 |
|
|
94 |
@Override |
|
95 |
protected String getNewLineChars() { |
|
96 |
return "\n"; |
|
97 |
} |
|
93 | 98 |
} |
org.gvsig.jvmpreferences/trunk/org.gvsig.jvmpreferences.native/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.linux/src/main/java/org/gvsig/jvmpreferences/nativeprefs/MemoryPreferencesLinux.java | ||
---|---|---|
60 | 60 |
//return "export GVSIG_MAX_MEM="+maximumMemory+"M"; |
61 | 61 |
return "GVSIG_MAX_MEM="+maximumMemory+"M"; |
62 | 62 |
} |
63 |
|
|
64 |
@Override |
|
65 |
protected String getNewLineChars() { |
|
66 |
return "\n"; |
|
67 |
} |
|
63 | 68 |
|
64 | 69 |
} |
Also available in: Unified diff