C# Класс CmisSync.Lib.Utils

Static methods that are useful in the context of synchronization.
Показать файл Открыть проект

Открытые методы

Метод Описание
ConfigureLogging ( ) : void
CreateConflictFilename ( String path, String user ) : string

Find an available conflict free filename for this file. For instance: - if /dir/file does not exist, return the same path - if /dir/file exists, return /dir/file (1) - if /dir/file (1) also exists, return /dir/file (2) - etc

CreateConflictFoldername ( String path, String user ) : string
DeleteEvenIfReadOnly ( string filePath ) : void
FirstFolderContainsSecond ( string containingFolder, string containedFolder ) : bool

Says whether a folder contains another. Example: FirstFolderContainsSecond("/a", "/a/b") => true

FormatBandwidth ( double bitsPerSecond ) : string

Formats the bandwidth in typical 10 based calculation

FormatBandwidth ( long bitsPerSecond ) : string

Formats the bandwidth in typical 10 based calculation

FormatSize ( double byteCount ) : string

Format a file size nicely. Example: 1048576 becomes "1 MB"

FormatSize ( long byteCount ) : string

Format a file size nicely. Example: 1048576 becomes "1 MB"

HasWritePermissionOnDir ( string path ) : bool

Check whether the current user has write permission to the specified path.

IsDirectoryWorthSyncing ( string localDirectory, RepoInfo repoInfo ) : bool

Check whether the directory is worth syncing or not. Directories that are not worth syncing include ignored, system, and hidden folders.

IsFileWorthSyncing ( string filepath, RepoInfo repoInfo ) : bool

Check whether the file is worth syncing or not. This optionally excludes blank files or files too large.

IsFolder ( string path ) : bool

Whether a path points to a local directory or not. Must be an absolute local path.

IsInvalidFileName ( string name ) : bool

Check whether a file name is valid or not.

IsInvalidFolderName ( string name ) : bool

Check whether a folder name is valid or not.

IsSymlink ( FileSystemInfo fsi ) : bool

Determines whether this instance is a symlink the specified FileSystemInfo.

IsSymlink ( string path ) : bool

Whether a file or directory is a symbolic link.

IsValidISO88591 ( string input ) : bool

Determines whether this instance is valid ISO-8859-1 specified input.

IsvalidURL ( string url ) : bool

Check whether an URL is valid or not.

MoveFolderLocally ( string origin, string destination ) : void
NotifyUser ( string message ) : void

Send a message to the end user.

PathCombine ( string localDirectory, string filename ) : string

Like Path.Combine, but does not choke on special characters. Special characters are a separate concern, use this method if it is not the current concern.

SetUserNotificationListener ( UserNotificationListener listener ) : void

Register the component which will receive notifications intended for the end-user.

UpperFolderLocal ( string localFolderPath ) : string

Get the upper folder of a local path.

WorthSyncing ( string filename ) : System.Boolean

Check whether the file is worth syncing or not. Files that are not worth syncing include temp files, locks, etc.

WorthSyncing ( string localDirectory, string filename, RepoInfo repoInfo ) : System.Boolean

Check whether the file is worth syncing or not. Files that are not worth syncing include temp files, locks, etc.

Приватные методы

Метод Описание
IsFilenameWorthSyncing ( string localDirectory, string filename ) : bool

Check whether the filename is worth syncing or not. Files that are not worth syncing include temp files, locks, etc.

Описание методов

ConfigureLogging() публичный статический Метод

public static ConfigureLogging ( ) : void
Результат void

CreateConflictFilename() публичный статический Метод

Find an available conflict free filename for this file. For instance: - if /dir/file does not exist, return the same path - if /dir/file exists, return /dir/file (1) - if /dir/file (1) also exists, return /dir/file (2) - etc
public static CreateConflictFilename ( String path, String user ) : string
path String Path of the file in conflict
user String Local user
Результат string

CreateConflictFoldername() публичный статический Метод

public static CreateConflictFoldername ( String path, String user ) : string
path String
user String
Результат string

DeleteEvenIfReadOnly() публичный статический Метод

public static DeleteEvenIfReadOnly ( string filePath ) : void
filePath string
Результат void

FirstFolderContainsSecond() публичный статический Метод

Says whether a folder contains another. Example: FirstFolderContainsSecond("/a", "/a/b") => true
public static FirstFolderContainsSecond ( string containingFolder, string containedFolder ) : bool
containingFolder string
containedFolder string
Результат bool

FormatBandwidth() публичный статический Метод

Formats the bandwidth in typical 10 based calculation
public static FormatBandwidth ( double bitsPerSecond ) : string
bitsPerSecond double /// Bits per second. ///
Результат string

FormatBandwidth() публичный статический Метод

Formats the bandwidth in typical 10 based calculation
public static FormatBandwidth ( long bitsPerSecond ) : string
bitsPerSecond long /// Bits per second. ///
Результат string

FormatSize() публичный статический Метод

Format a file size nicely. Example: 1048576 becomes "1 MB"
public static FormatSize ( double byteCount ) : string
byteCount double
Результат string

FormatSize() публичный статический Метод

Format a file size nicely. Example: 1048576 becomes "1 MB"
public static FormatSize ( long byteCount ) : string
byteCount long
Результат string

HasWritePermissionOnDir() публичный статический Метод

Check whether the current user has write permission to the specified path.
public static HasWritePermissionOnDir ( string path ) : bool
path string
Результат bool

IsDirectoryWorthSyncing() публичный статический Метод

Check whether the directory is worth syncing or not. Directories that are not worth syncing include ignored, system, and hidden folders.
public static IsDirectoryWorthSyncing ( string localDirectory, RepoInfo repoInfo ) : bool
localDirectory string
repoInfo RepoInfo
Результат bool

IsFileWorthSyncing() публичный статический Метод

Check whether the file is worth syncing or not. This optionally excludes blank files or files too large.
public static IsFileWorthSyncing ( string filepath, RepoInfo repoInfo ) : bool
filepath string
repoInfo RepoInfo
Результат bool

IsFolder() публичный статический Метод

Whether a path points to a local directory or not. Must be an absolute local path.
public static IsFolder ( string path ) : bool
path string
Результат bool

IsInvalidFileName() публичный статический Метод

Check whether a file name is valid or not.
public static IsInvalidFileName ( string name ) : bool
name string
Результат bool

IsInvalidFolderName() публичный статический Метод

Check whether a folder name is valid or not.
public static IsInvalidFolderName ( string name ) : bool
name string
Результат bool

IsSymlink() публичный статический Метод

Determines whether this instance is a symlink the specified FileSystemInfo.
public static IsSymlink ( FileSystemInfo fsi ) : bool
fsi System.IO.FileSystemInfo /// If set to true fsi. ///
Результат bool

IsSymlink() публичный статический Метод

Whether a file or directory is a symbolic link.
public static IsSymlink ( string path ) : bool
path string
Результат bool

IsValidISO88591() публичный статический Метод

Determines whether this instance is valid ISO-8859-1 specified input.
public static IsValidISO88591 ( string input ) : bool
input string If set to true input.
Результат bool

IsvalidURL() публичный статический Метод

Check whether an URL is valid or not.
public static IsvalidURL ( string url ) : bool
url string
Результат bool

MoveFolderLocally() публичный статический Метод

public static MoveFolderLocally ( string origin, string destination ) : void
origin string
destination string
Результат void

NotifyUser() публичный статический Метод

Send a message to the end user.
public static NotifyUser ( string message ) : void
message string
Результат void

PathCombine() публичный статический Метод

Like Path.Combine, but does not choke on special characters. Special characters are a separate concern, use this method if it is not the current concern.
public static PathCombine ( string localDirectory, string filename ) : string
localDirectory string
filename string
Результат string

SetUserNotificationListener() публичный статический Метод

Register the component which will receive notifications intended for the end-user.
public static SetUserNotificationListener ( UserNotificationListener listener ) : void
listener UserNotificationListener
Результат void

UpperFolderLocal() публичный статический Метод

Get the upper folder of a local path.
public static UpperFolderLocal ( string localFolderPath ) : string
localFolderPath string
Результат string

WorthSyncing() публичный статический Метод

Check whether the file is worth syncing or not. Files that are not worth syncing include temp files, locks, etc.
public static WorthSyncing ( string filename ) : System.Boolean
filename string
Результат System.Boolean

WorthSyncing() публичный статический Метод

Check whether the file is worth syncing or not. Files that are not worth syncing include temp files, locks, etc.
public static WorthSyncing ( string localDirectory, string filename, RepoInfo repoInfo ) : System.Boolean
localDirectory string
filename string
repoInfo RepoInfo
Результат System.Boolean