mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Create a transaction for a write when the current content channel is not writable.
Fixes a NullPointerException, AR-1129. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4509 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1510,11 +1510,11 @@ public class AVMDiskDriver extends AlfrescoDiskDriver implements DiskInterface {
|
|||||||
if ( file.isDirectory())
|
if ( file.isDirectory())
|
||||||
throw new AccessDeniedException();
|
throw new AccessDeniedException();
|
||||||
|
|
||||||
// If the content channel is not open for the file then start a transaction
|
// If the content channel is not open for the file, or the channel is not writable, then start a transaction
|
||||||
|
|
||||||
AVMNetworkFile avmFile = (AVMNetworkFile) file;
|
AVMNetworkFile avmFile = (AVMNetworkFile) file;
|
||||||
|
|
||||||
if ( avmFile.hasContentChannel() == false)
|
if ( avmFile.hasContentChannel() == false || avmFile.isWritable() == false)
|
||||||
sess.beginTransaction( m_transactionService, true);
|
sess.beginTransaction( m_transactionService, true);
|
||||||
|
|
||||||
// Write the data to the file
|
// Write the data to the file
|
||||||
|
@@ -467,6 +467,16 @@ public class AVMNetworkFile extends NetworkFile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the writable state of the content channel
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public final boolean isWritable()
|
||||||
|
{
|
||||||
|
return m_writable;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the network file details as a string
|
* Return the network file details as a string
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user