Lines 393-401
Link Here
|
393 |
/** |
393 |
/** |
394 |
* Tries to load the original file from a shadow. |
394 |
* Tries to load the original file from a shadow. |
395 |
* Looks for file contents as well as the originalFile/originalFileSystem attributes. |
395 |
* Looks for file contents as well as the originalFile/originalFileSystem attributes. |
|
|
396 |
* Attempts to discover locations for migrated files in configuration. |
397 |
* |
396 |
* @param fileObject a data shadow |
398 |
* @param fileObject a data shadow |
397 |
* @return the original <code>DataObject</code> referenced by the shadow |
399 |
* @return the original <code>DataObject</code> referenced by the shadow |
398 |
* @throws IOException error during load or broken link |
400 |
* @throws IOException error during load or broken link |
|
|
401 |
* |
402 |
* @see Utilities#translate |
399 |
*/ |
403 |
*/ |
400 |
protected static DataObject deserialize(FileObject fileObject) throws IOException { |
404 |
protected static DataObject deserialize(FileObject fileObject) throws IOException { |
401 |
String[] fileAndFileSystem = readOriginalFileAndFileSystem(fileObject); |
405 |
String[] fileAndFileSystem = readOriginalFileAndFileSystem(fileObject); |
Lines 411-416
Link Here
|
411 |
String fsname = fileAndFileSystem[1]; |
415 |
String fsname = fileAndFileSystem[1]; |
412 |
if (u != null && u.isAbsolute()) { |
416 |
if (u != null && u.isAbsolute()) { |
413 |
target = URLMapper.findFileObject(u.toURL()); |
417 |
target = URLMapper.findFileObject(u.toURL()); |
|
|
418 |
if (target == null) { |
419 |
FileObject cfgRoot = FileUtil.getConfigRoot(); |
420 |
String prefix = cfgRoot.toURI().toString(); |
421 |
String urlText = u.toString(); |
422 |
// try to recover a broken shadow by translation, but only for |
423 |
// configuration |
424 |
if (urlText.startsWith(prefix)) { |
425 |
String cfgPart = urlText.substring(prefix.length()); |
426 |
String translated = Utilities.translate(cfgPart); |
427 |
// intentional - the parameter is returned unchanged if no translation is found |
428 |
if (translated != cfgPart) { |
429 |
try { |
430 |
u = new URI(prefix + translated); |
431 |
} catch (URISyntaxException ex) { |
432 |
u = null; |
433 |
} |
434 |
if (u != null) { |
435 |
target = URLMapper.findFileObject(u.toURL()); |
436 |
} |
437 |
} |
438 |
} |
439 |
} |
414 |
} else { |
440 |
} else { |
415 |
FileSystem fs; |
441 |
FileSystem fs; |
416 |
if (SFS_NAME.equals(fsname)) { |
442 |
if (SFS_NAME.equals(fsname)) { |