Revision 312

View differences:

org.gvsig.educa.portableview/trunk/org.gvsig.educa.portableview/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.impl/src/main/java/org/gvsig/educa/portableview/impl/util/PersistenceUtils.java
31 31
import java.util.Map;
32 32
import java.util.Set;
33 33

  
34
import org.apache.commons.lang3.StringUtils;
34 35
import org.gvsig.tools.dynobject.DynField;
35 36
import org.gvsig.tools.dynobject.DynStruct;
36 37
import org.gvsig.tools.persistence.PersistentContext;
......
197 198
					try {
198 199
						URL value = aState.getURL(field.getName());
199 200
						if ("FILE".equalsIgnoreCase(value.getProtocol())) {
200
							relatedFiles.add(new File(value.getFile()));
201
							String fixedName = replaceWhiteSpaces(value.getFile());
202
							relatedFiles.add(new File(fixedName));
201 203
						}
202 204
					} catch (PersistenceException e) {
203 205
						// do nothing
......
210 212

  
211 213
	/**
212 214
	 * <p>
215
	 * Replace all %20 in filePath with " " to get the correct file path
216
	 * </p>
217
	 *
218
	 * @param filePath Path to file
219
	 * @return Path to file without %20
220
	 */
221
	private static String replaceWhiteSpaces(String filePath) {
222
		return StringUtils.replace(filePath, "%20", " ");
223
	}
224

  
225
	/**
226
	 * <p>
213 227
	 * Adjust all Files in <code>state</code> based on
214 228
	 * <code>transformMapping</code>.
215 229
	 * </p>

Also available in: Unified diff