com.microsoft.tfs.core.clients.versioncontrol.localworkspace
Class BaselineFolder

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.localworkspace.BaselineFolder

public class BaselineFolder
extends java.lang.Object


Field Summary
 java.lang.String partition
           
 java.lang.String path
           
 com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState state
           
 
Constructor Summary
BaselineFolder(java.lang.String partition, java.lang.String path, com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState state)
           
 
Method Summary
static void checkForValidBaselineFileGUID(byte[] baselineFileGuid)
          Throws an ArgumentException if the baseline file GUID provided is null or has a length != 16 bytes.
 BaselineFolder clone()
           
static BaselineFolder create(Workspace workspace, java.lang.String localFolder)
          Given the location at which a baseline folder should be created, creates a baseline folder on disk and returns it.
static void createBaselineFolderStructure(java.lang.String path)
          Given a path, creates a baseline folder structure at that path.
static void ensureBaselineDirectoryExists(Workspace workspace, java.lang.String directoryPath)
           
static void ensureLocalMetadataDirectoryExists(Workspace workspace)
          Ensures that the local metadata directory for the given local workspace exists.
static void ensureLocalMetadataDirectoryExists(Workspace workspace, java.lang.String sourceDirectoryForAcl)
          Ensures that the local metadata directory for the given local workspace exists.
 boolean equals(java.lang.Object obj)
           
static java.lang.String getBaselineFolderName()
           
static java.lang.String getGzipExtension()
           
static java.lang.String getPartitionForPath(java.lang.String localItem)
           
static int getPartitioningFolderCount()
           
 java.lang.String getPath()
           
 java.lang.String getPathFromGUID(byte[] baselineFileGuid)
          Given a baseline file GUID, calculates the path that this baseline file GUID would have in this baseline folder, without the extension (.rw or .gz).
static java.lang.String getPathFromGUID(java.lang.String baselineFolderRootPath, byte[] baselineFileGuid)
          Given the root baseline folder and a baseline file GUID, calculates the path that this baseline file GUID would have in that root folder, without the extension (.rw or .gz).
static java.lang.String getPathFromGUID(java.lang.String baselineFolderRootPath, byte[] baselineFileGuid, java.util.concurrent.atomic.AtomicReference<java.lang.String> individualBaselineFolder)
          Given the root baseline folder and a baseline file GUID, calculates the path that this baseline file GUID would have in that root folder, without the extension (.rw or .gz).
static java.lang.String getRawExtension()
           
 com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState getState()
           
 int hashCode()
           
static boolean isPotentialBaselineFolderName(java.lang.String folderName)
          Returns true is if the specified folderName is that of a potential baseline folder name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

partition

public java.lang.String partition

path

public java.lang.String path

state

public com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState state
Constructor Detail

BaselineFolder

public BaselineFolder(java.lang.String partition,
                      java.lang.String path,
                      com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState state)
Method Detail

clone

public BaselineFolder clone()
Overrides:
clone in class java.lang.Object

create

public static BaselineFolder create(Workspace workspace,
                                    java.lang.String localFolder)
Given the location at which a baseline folder should be created, creates a baseline folder on disk and returns it.

Parameters:
localFolder -
Returns:

createBaselineFolderStructure

public static void createBaselineFolderStructure(java.lang.String path)
Given a path, creates a baseline folder structure at that path. Example paths: @"D:\workspace\$tf" and "C:\ProgramData\TFS\Offline\[guid]\ws1;[domain/user]

Parameters:
path -

ensureLocalMetadataDirectoryExists

public static void ensureLocalMetadataDirectoryExists(Workspace workspace)
Ensures that the local metadata directory for the given local workspace exists. The path looks like: "C:\ProgramData\TFS\Offline\\" The method has special logic to place an access control entry on the folder for the owner, and to take ownership from BUILTIN\Administrators. (This logic only runs if the directory is actually created by this method.)

Parameters:
workspace - Workspace whose local metadata directory's existence should be ensured

ensureLocalMetadataDirectoryExists

public static void ensureLocalMetadataDirectoryExists(Workspace workspace,
                                                      java.lang.String sourceDirectoryForAcl)
Ensures that the local metadata directory for the given local workspace exists. The path looks like: "C:\ProgramData\TFS\Offline\\" on Windows and "~/.microsoft/Team Foundation/4.0/Configuration/TFS-Offline" on Unix. On Windows, the method has special logic to place an access control entry on the folder for the owner, and to take ownership from BUILTIN\Administrators. (This logic only runs if the directory is actually created by this method.) The method will also clone any additional access control entries from the provided sourceDirectoryForAcl directory.

Parameters:
workspace - Workspace whose local metadata directory's existence should be ensured
sourceDirectoryForAcl - Source directory for the access control list

ensureBaselineDirectoryExists

public static void ensureBaselineDirectoryExists(Workspace workspace,
                                                 java.lang.String directoryPath)

isPotentialBaselineFolderName

public static boolean isPotentialBaselineFolderName(java.lang.String folderName)
Returns true is if the specified folderName is that of a potential baseline folder name.

Parameters:
folderName - The folder name to test (just the name not the full path).

getPathFromGUID

public java.lang.String getPathFromGUID(byte[] baselineFileGuid)
Given a baseline file GUID, calculates the path that this baseline file GUID would have in this baseline folder, without the extension (.rw or .gz).

Parameters:
baselineFileGuid -
Returns:

getPathFromGUID

public static java.lang.String getPathFromGUID(java.lang.String baselineFolderRootPath,
                                               byte[] baselineFileGuid)
Given the root baseline folder and a baseline file GUID, calculates the path that this baseline file GUID would have in that root folder, without the extension (.rw or .gz). Example values for baselineFolderRootPath: @"D:\workspace\$tf" -- from the instance method GetPathFromGuid immediately above and "C:\ProgramData\TFS\Offline\[guid]\ws1;[domain/user]

Parameters:
baselineFolderRootPath - Root folder of the baseline folder structure
baselineFileGuid - Baseline file GUID whose path should be computed
Returns:

getPathFromGUID

public static java.lang.String getPathFromGUID(java.lang.String baselineFolderRootPath,
                                               byte[] baselineFileGuid,
                                               java.util.concurrent.atomic.AtomicReference<java.lang.String> individualBaselineFolder)
Given the root baseline folder and a baseline file GUID, calculates the path that this baseline file GUID would have in that root folder, without the extension (.rw or .gz). Example values for baselineFolderRootPath: "D:\workspace\$tf" -- from the instance method GetPathFromGuid immediately above "C:\ProgramData\TFS\Offline\\"

Parameters:
baselineFolderRootPath - Root folder of the baseline folder structure
baselineFileGuid - Baseline file GUID whose path should be computed
String - [out] A value equal to Path.GetDirectoryName(retval)
Returns:

checkForValidBaselineFileGUID

public static void checkForValidBaselineFileGUID(byte[] baselineFileGuid)
Throws an ArgumentException if the baseline file GUID provided is null or has a length != 16 bytes.

Parameters:
baselineFileGuid - Baseline file GUID to check

getPath

public java.lang.String getPath()

getState

public com.microsoft.tfs.core.clients.versioncontrol.internal.localworkspace.BaselineFolderState getState()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPartitionForPath

public static java.lang.String getPartitionForPath(java.lang.String localItem)

getBaselineFolderName

public static java.lang.String getBaselineFolderName()

getGzipExtension

public static java.lang.String getGzipExtension()

getRawExtension

public static java.lang.String getRawExtension()

getPartitioningFolderCount

public static int getPartitioningFolderCount()


© 2015 Microsoft. All rights reserved.