Beispiel #1
0
 private VolumeSnapshotFile(VolumeSnapshot snapshot, VolumeSource source, string relativePath)
 {
     mSnapshot     = snapshot;
     mRevision     = null;
     mRelativePath = relativePath;
     mFileName     = PWLib.Platform.Windows.Path.GetFileName(relativePath);
     mLastModified = source.GetLastWriteTimeUtc(relativePath);
     mFileSize     = source.GetFileSize(relativePath);
 }
 private VolumeSnapshotFile( VolumeSnapshot snapshot, VolumeSource source, string relativePath )
 {
     mSnapshot = snapshot;
     mRevision = null;
     mRelativePath = relativePath;
     mFileName = PWLib.Platform.Windows.Path.GetFileName( relativePath );
     mLastModified = source.GetLastWriteTimeUtc( relativePath );
     mFileSize = source.GetFileSize( relativePath );
 }
        private VolumeSnapshotDirectory( VolumeSnapshot snapshot, VolumeSource source, string relativePath )
        {
            mSnapshot = snapshot;
            mRelativePath = relativePath;
            mName = mRelativePath.Length <= 1 ? "" : PWLib.Platform.Windows.Path.GetLeafName( relativePath );
            mLastModified = source.GetLastWriteTimeUtc( relativePath );// PWLib.Platform.Windows.Directory.GetLastWriteTimeUtc( rootDir );

            foreach ( string filename in source.GetRelativePathFiles( relativePath ) /* PWLib.Platform.Windows.Directory.GetFiles( rootDir ) */ )
            {
                try
                {
                    VolumeSnapshotFile fileEntry = VolumeSnapshotFile.BuildFromSource( mSnapshot, source, filename );
                    mFiles.Add( fileEntry );
                }
                catch ( System.Exception e )
                {
                    FileSync.__LogError( this, "VolumeSnapshotDirectory.BuildFromFileSystem failed on file '" + filename + "'", e );
                }
            }

            foreach ( string subDir in source.GetRelativePathDirectories( relativePath ) )
            {
                try
                {
                    if ( !IsIgnoredDirectoryName( PWLib.Platform.Windows.Path.GetLeafName( subDir ) ) )
                    {
                        VolumeSnapshotDirectory subDirEntry = new VolumeSnapshotDirectory( mSnapshot, source, subDir );
                        mDirectories.Add( subDirEntry );
                    }
                }
                catch ( System.Exception e )
                {
                    FileSync.__LogError( this, "VolumeSnapshotDirectory.BuildFromFileSystem failed on directory '" + subDir + "'", e );
                }
            }
        }
Beispiel #4
0
        private VolumeSnapshotDirectory(VolumeSnapshot snapshot, VolumeSource source, string relativePath)
        {
            mSnapshot     = snapshot;
            mRelativePath = relativePath;
            mName         = mRelativePath.Length <= 1 ? "" : PWLib.Platform.Windows.Path.GetLeafName(relativePath);
            mLastModified = source.GetLastWriteTimeUtc(relativePath);              // PWLib.Platform.Windows.Directory.GetLastWriteTimeUtc( rootDir );

            foreach (string filename in source.GetRelativePathFiles(relativePath) /* PWLib.Platform.Windows.Directory.GetFiles( rootDir ) */)
            {
                try
                {
                    VolumeSnapshotFile fileEntry = VolumeSnapshotFile.BuildFromSource(mSnapshot, source, filename);
                    mFiles.Add(fileEntry);
                }
                catch (System.Exception e)
                {
                    FileSync.__LogError(this, "VolumeSnapshotDirectory.BuildFromFileSystem failed on file '" + filename + "'", e);
                }
            }

            foreach (string subDir in source.GetRelativePathDirectories(relativePath))
            {
                try
                {
                    if (!IsIgnoredDirectoryName(PWLib.Platform.Windows.Path.GetLeafName(subDir)))
                    {
                        VolumeSnapshotDirectory subDirEntry = new VolumeSnapshotDirectory(mSnapshot, source, subDir);
                        mDirectories.Add(subDirEntry);
                    }
                }
                catch (System.Exception e)
                {
                    FileSync.__LogError(this, "VolumeSnapshotDirectory.BuildFromFileSystem failed on directory '" + subDir + "'", e);
                }
            }
        }