(Samu Viita) Added JSPUI-like logging of bitstreams downloads.

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@2451 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Scott Phillips
2007-12-17 23:37:29 +00:00
parent 49e047fff4
commit d062e0db04

View File

@@ -73,6 +73,9 @@ import org.dspace.core.Context;
import org.dspace.handle.HandleManager;
import org.xml.sax.SAXException;
import org.apache.log4j.Logger;
import org.dspace.core.LogManager;
/**
* The BitstreamReader will query DSpace for a particular bitstream and transmit
* it to the user. There are several method of specifing the bitstream to be
@@ -123,6 +126,8 @@ import org.xml.sax.SAXException;
public class BitstreamReader extends AbstractReader implements Recyclable
{
private static Logger log = Logger.getLogger(BitstreamReader.class);
/**
* Messages to be sent when the user is not authorized to view
* a particular bitstream. They will be redirected to the login
@@ -277,6 +282,9 @@ public class BitstreamReader extends AbstractReader implements Recyclable
this.bitstreamInputStream = bitstream.retrieve();
this.bitstreamSize = bitstream.getSize();
this.bitstreamMimeType = bitstream.getFormat().getMIMEType();
// Log that the bitstream has been viewed.
log.info(LogManager.getHeader(context, "view_bitstream", "bitstream_id=" + bitstream.getID()));
}
catch (SQLException sqle)
{