Revision: 3516 http://archive-access.svn.sourceforge.net/archive-access/?rev=3516&view=rev Author: bradtofel Date: 2011-09-06 03:49:28 +0000 (Tue, 06 Sep 2011) Log Message: ----------- LOGGING Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/resourcefile/ResourceFactory.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/resourcefile/ResourceFactory.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/resourcefile/ResourceFactory.java 2011-09-06 03:48:39 UTC (rev 3515) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/resourcefile/ResourceFactory.java 2011-09-06 03:49:28 UTC (rev 3516) @@ -25,6 +25,7 @@ import java.io.InputStream; import java.io.RandomAccessFile; import java.net.URL; +import java.util.logging.Logger; import org.archive.io.ArchiveReader; import org.archive.io.ArchiveRecord; @@ -46,14 +47,25 @@ * @version $Date$, $Revision$ */ public class ResourceFactory { + private static final Logger LOGGER = + Logger.getLogger(ResourceFactory.class.getName()); public static Resource getResource(String urlOrPath, long offset) throws IOException, ResourceNotAvailableException { - if(urlOrPath.startsWith("http://")) { - return getResource(new URL(urlOrPath), offset); - } else { - // assume local path: - return getResource(new File(urlOrPath), offset); + LOGGER.info("Fetching: " + urlOrPath + " : " + offset); + try { + if(urlOrPath.startsWith("http://")) { + return getResource(new URL(urlOrPath), offset); + } else { + // assume local path: + return getResource(new File(urlOrPath), offset); + } + } catch(ResourceNotAvailableException e) { + LOGGER.warning("ResourceNotAvailable for " + urlOrPath + " " + e.getMessage()); + throw e; + } catch(IOException e) { + LOGGER.warning("ResourceNotAvailable for " + urlOrPath + " " + e.getMessage()); + throw e; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |