If an absolute file is missing try resolving it in the directory the
file was loaded from
This commit is contained in:
parent
a780b8da93
commit
e97ae2f4b0
@ -15,10 +15,13 @@ import java.util.zip.ZipEntry;
|
|||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
import net.sf.openrocket.file.FileInfo;
|
import net.sf.openrocket.file.FileInfo;
|
||||||
|
import net.sf.openrocket.logging.LogHelper;
|
||||||
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.util.BugException;
|
import net.sf.openrocket.util.BugException;
|
||||||
import net.sf.openrocket.util.FileUtils;
|
import net.sf.openrocket.util.FileUtils;
|
||||||
|
|
||||||
public class DecalRegistry {
|
public class DecalRegistry {
|
||||||
|
private static LogHelper log = Application.getLogger();
|
||||||
|
|
||||||
private FileInfo fileInfo;
|
private FileInfo fileInfo;
|
||||||
private boolean isZipFile = false;
|
private boolean isZipFile = false;
|
||||||
@ -105,7 +108,12 @@ public class DecalRegistry {
|
|||||||
if ( rawIs == null ) {
|
if ( rawIs == null ) {
|
||||||
File decal = new File(name);
|
File decal = new File(name);
|
||||||
if ( decal.isAbsolute() ) {
|
if ( decal.isAbsolute() ) {
|
||||||
|
try {
|
||||||
rawIs = new FileInputStream(decal);
|
rawIs = new FileInputStream(decal);
|
||||||
|
} catch ( FileNotFoundException e ){
|
||||||
|
name = decal.getName();
|
||||||
|
log.debug("Unable to find absolute file" + decal + ", falling back to " + name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user