[vassalengine-svn-trunk] [vassalengine-svn] SF.net SVN: vassalengine:[7915] VASSAL-src/trunk/src/VA
Brought to you by:
rodneykinney,
uckelman
From: <uck...@us...> - 2011-10-14 21:47:05
|
Revision: 7915 http://vassalengine.svn.sourceforge.net/vassalengine/?rev=7915&view=rev Author: uckelman Date: 2011-10-14 21:46:58 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Reintroduced check for extentionless GIFs. Blech, we'll never be rid of this in the V3 line. Modified Paths: -------------- VASSAL-src/trunk/src/VASSAL/tools/DataArchive.java Modified: VASSAL-src/trunk/src/VASSAL/tools/DataArchive.java =================================================================== --- VASSAL-src/trunk/src/VASSAL/tools/DataArchive.java 2011-10-14 20:54:05 UTC (rev 7914) +++ VASSAL-src/trunk/src/VASSAL/tools/DataArchive.java 2011-10-14 21:46:58 UTC (rev 7915) @@ -197,13 +197,35 @@ // requested file is a resource, try our JARs if (fileName.startsWith("/")) { final InputStream in = getClass().getResourceAsStream(fileName); - if (in != null) return in; + if (in != null) { + return in; + } throw new FileNotFoundException("Resource not found: " + fileName); } + // Look in this archive and its extensions + InputStream in = getInputStreamImpl(fileName); + if (in != null) { + return in; + } + + // Maybe it's an extensionless GIF? Aauugh! + in = getInputStreamImpl(fileName + ".gif"); + if (in != null) { + return in; + } + + throw new FileNotFoundException( + "\'" + fileName + "\' not found in " + getName() + ); + } + + private InputStream getInputStreamImpl(String fileName) + throws IOException, FileNotFoundException { // requested file is in this archive - if (archive != null && archive.contains(fileName)) + if (archive != null && archive.contains(fileName)) { return archive.getInputStream(fileName); + } // we don't have it, try our extensions for (DataArchive ext : extensions) { @@ -215,8 +237,7 @@ } } - throw new FileNotFoundException( - "\'" + fileName + "\' not found in " + getName()); + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct _______________________________________________ vassalengine-svn mailing list vas...@li... https://lists.sourceforge.net/lists/listinfo/vassalengine-svn |