mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added a method to AVMService and its dependent services to get an InputStream
directly from a node descriptor. It's a minor optimization for a few use scenarios. It's also convenient for accessing content of historical file versions directly. Another CLT, to list the versions of a store. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4496 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -250,6 +250,23 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemoteTransport#getInputHandle(java.lang.String, org.alfresco.service.cmr.avm.AVMNodeDescriptor)
|
||||
*/
|
||||
public String getInputHandle(String ticket, AVMNodeDescriptor desc)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
InputStream in = fAVMService.getFileInputStream(desc);
|
||||
String handle = GUID.generate();
|
||||
synchronized (this)
|
||||
{
|
||||
fInputStreams.put(handle, in);
|
||||
fInputLastAccessTimes.put(handle, System.currentTimeMillis());
|
||||
fInputBusy.put(handle, false);
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a chunk of data from a handle.
|
||||
* @param handle The opaque input stream handle.
|
||||
@@ -611,10 +628,10 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
|
||||
* @param store The name of the AVMStore to snapshot.
|
||||
* @return The version id of the new snapshot.
|
||||
*/
|
||||
public int createSnapshot(String ticket, String store)
|
||||
public int createSnapshot(String ticket, String store, String label, String comment)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fAVMService.createSnapshot(store, null, null);
|
||||
return fAVMService.createSnapshot(store, label, comment);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user