mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
First cut of the AVM filesystem driver for CIFS/FTP support.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4388 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
103
source/java/org/alfresco/filesys/avm/AVMContext.java
Normal file
103
source/java/org/alfresco/filesys/avm/AVMContext.java
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2006 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
|
||||
package org.alfresco.filesys.avm;
|
||||
|
||||
import org.alfresco.filesys.server.filesys.DiskDeviceContext;
|
||||
import org.alfresco.filesys.server.filesys.FileSystem;
|
||||
|
||||
/**
|
||||
* AVM Filesystem Context Class
|
||||
*
|
||||
* <p>Contains per filesystem context.
|
||||
*
|
||||
* @author GKSpencer
|
||||
*/
|
||||
public class AVMContext extends DiskDeviceContext {
|
||||
|
||||
// Constants
|
||||
//
|
||||
// Version id that indicates the head version
|
||||
|
||||
public static final int VERSION_HEAD = -1;
|
||||
|
||||
// Store, root path and version
|
||||
|
||||
private String m_storePath;
|
||||
private int m_version = VERSION_HEAD;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param storePath String
|
||||
* @param version int
|
||||
*/
|
||||
public AVMContext( String storePath, int version)
|
||||
{
|
||||
super( storePath + "(" + version + ")");
|
||||
|
||||
// Set the store root path, remove any trailing slash as relative paths will be appended to this value
|
||||
|
||||
m_storePath = storePath;
|
||||
if ( m_storePath.endsWith( "/"))
|
||||
m_storePath = m_storePath.substring(0, m_storePath.length() - 1);
|
||||
|
||||
// Set the store version to use
|
||||
|
||||
m_version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the filesystem type, either FileSystem.TypeFAT or FileSystem.TypeNTFS.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getFilesystemType()
|
||||
{
|
||||
return FileSystem.TypeNTFS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the store path
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public final String getStorePath()
|
||||
{
|
||||
return m_storePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public final int isVersion()
|
||||
{
|
||||
return m_version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the filesystem context
|
||||
*/
|
||||
public void CloseContext() {
|
||||
|
||||
// Call the base class
|
||||
|
||||
super.CloseContext();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user