@Override
	public boolean handle(Request request, Response response) {
		// get the series 
		BasicSeries series = null;
		try {
			String id_ = request.path.substring(
					request.path.lastIndexOf('/')+1);
			int id = Integer.parseInt(id_);
			

			Series s = Profile.getInstance()
				.getSeries().getById(id);
			if (!s.isManaged()) {
				System.err.println("unmanaged series");
				return showDefault(response);
			}
			
			series = (BasicSeries) s;
		} catch (StringIndexOutOfBoundsException e) {
			// no valid id
			return showDefault(response);
		} catch (NumberFormatException e) {
			// not valid id
			return showDefault(response);
		} catch (ClassCastException e) {
			// untracked, no local path
			return showDefault(response);
		}
		
//		if (series == null) {
//			return showDefault(response);
//		}
		
		String localPath = series.getLocalPath();
		File localFile = new File(localPath);
		
		File[] files = localFile.listFiles(FILENAME_FILTER);
		if (files == null || files.length == 0) {
			return showDefault(response);
		}
		
		File theFile = files[0]; // pick first candidate
		if (!theFile.exists()) {		
//			System.err.println("Cannot find: " + path + " (" +
//			        theFile.getAbsolutePath() + ")");
			System.err.println("No such file: " + theFile.getAbsolutePath());
			return showDefault(response);
		}
		if (!theFile.canRead()) {
//			System.err.println("Cannot read: " + theFile.getAbsolutePath());
			return showDefault(response);
		}
		
		return showFile(response, theFile, request);
	}