예제 #1
0
        public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
        {
            oStorageFileInfo = null;
            ErrorTypes eError = ErrorTypes.StorageGetInfo;

            try
            {
                string strFileKey = GetFilePath(strPath);
                using (Amazon.S3.AmazonS3 oS3Client = Amazon.AWSClientFactory.CreateAmazonS3Client(m_oRegion))
                {
                    Amazon.S3.Model.GetObjectMetadataRequest oRequest = new Amazon.S3.Model.GetObjectMetadataRequest()
                                                                        .WithBucketName(m_strBucketName).WithKey(strFileKey);

                    using (Amazon.S3.Model.GetObjectMetadataResponse oResponse = oS3Client.GetObjectMetadata(oRequest))
                    {
                        oStorageFileInfo = new StorageFileInfo(oResponse.ContentLength, oResponse.LastModified);
                        eError           = ErrorTypes.NoError;
                    }
                }
            }
            catch
            {
            }
            return(eError);
        }
예제 #2
0
        public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
        {
            oStorageFileInfo = null;
            ErrorTypes eError = ErrorTypes.NoError;

            try
            {
                FileInfo fi = new FileInfo(GetFilePath(strPath));
                if (fi.Exists)
                {
                    oStorageFileInfo = new StorageFileInfo(fi.Length, fi.LastWriteTimeUtc);
                }
                else
                {
                    eError = ErrorTypes.StorageFileNoFound;
                }
            }
            catch
            {
                eError = ErrorTypes.StorageGetInfo;
            }
            return(eError);
        }
예제 #3
0
 public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
 {
     oStorageFileInfo = null;
     ErrorTypes eError = ErrorTypes.NoError;
     try
     {
         FileInfo fi = new FileInfo(GetFilePath(strPath));
         if (fi.Exists)
         oStorageFileInfo = new StorageFileInfo(fi.Length, fi.LastWriteTimeUtc);
         else
             eError = ErrorTypes.StorageFileNoFound;
     }
     catch
     {
         eError = ErrorTypes.StorageGetInfo;
     }
     return eError;
 }
예제 #4
0
        public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
        {
            oStorageFileInfo = null;
            ErrorTypes eError = ErrorTypes.StorageGetInfo;

            try
            {
                string strFileKey = GetFilePath(strPath);
                using (Amazon.S3.AmazonS3 oS3Client = Amazon.AWSClientFactory.CreateAmazonS3Client(m_oRegion))
                {
                    Amazon.S3.Model.GetObjectMetadataRequest oRequest = new Amazon.S3.Model.GetObjectMetadataRequest()
                        .WithBucketName(m_strBucketName).WithKey(strFileKey);

                    using(Amazon.S3.Model.GetObjectMetadataResponse oResponse = oS3Client.GetObjectMetadata(oRequest))
                    {
                        oStorageFileInfo = new StorageFileInfo(oResponse.ContentLength, oResponse.LastModified);
                        eError = ErrorTypes.NoError;
                    }
                }
            }
            catch
            {
            }
            return eError;
        }
예제 #5
0
 public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
 {
     return oStorage.GetFileInfo(strPath, out oStorageFileInfo);
 }
예제 #6
0
 public ErrorTypes GetFileInfo(string strPath, out StorageFileInfo oStorageFileInfo)
 {
     return(oStorage.GetFileInfo(strPath, out oStorageFileInfo));
 }