mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
(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:
@@ -73,6 +73,9 @@ import org.dspace.core.Context;
|
|||||||
import org.dspace.handle.HandleManager;
|
import org.dspace.handle.HandleManager;
|
||||||
import org.xml.sax.SAXException;
|
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
|
* 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
|
* 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
|
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
|
* Messages to be sent when the user is not authorized to view
|
||||||
* a particular bitstream. They will be redirected to the login
|
* 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.bitstreamInputStream = bitstream.retrieve();
|
||||||
this.bitstreamSize = bitstream.getSize();
|
this.bitstreamSize = bitstream.getSize();
|
||||||
this.bitstreamMimeType = bitstream.getFormat().getMIMEType();
|
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)
|
catch (SQLException sqle)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user