OCISDK/OCISDK/ObjectStorage/IO/ObjectStorageDirectoryInfo.cs
/// <summary>
/// returns files in a directory according to the specified search pattern
/// </summary>
/// <param name="searchPattern"></param>
/// <param name="searchOption"></param>
/// <returns></returns>
returns files in a directory according to the specified search pattern
returns files in a directory according to the specified search pattern
public IEnumerable<ObjectStorageFileInfo> EnumerateFiles(string searchPattern, SearchOption searchOption, int maxCount, string nextPageId)
        {
            IEnumerable<ObjectStorageFileInfo> files = null;
            if (String.IsNullOrEmpty(BucketName))
            {
                files = new List<ObjectStorageFileInfo>();
            }
            else
            {
                var metaFiles = GetOciObjects(ObjectKey, searchOption, maxCount, nextPageId).Where(f => !f.Name.EndsWith("/")).ToList();
                files = new EnumerableConverter<ObjectSummary, ObjectStorageFileInfo>
                    (metaFiles, o => new ObjectStorageFileInfo(Client, NamespaceName, BucketName, ObjectStorageHelper.DecodeKey(o.Name)));
            }
            var regEx = WildcardToRegex(searchPattern);
            files = files.Where(o => Regex.IsMatch(o.Name, regEx, RegexOptions.IgnoreCase));
            return files;
        }
public IEnumerable < ObjectStorageFileInfo > EnumerateFiles ( string searchPattern , SearchOption searchOption , int maxCount , string nextPageId ) { IEnumerable < ObjectStorageFileInfo > files = null ; if ( String . IsNullOrEmpty ( BucketName ) ) { files = new List < ObjectStorageFileInfo > ( ) ; } else { var metaFiles = GetOciObjects ( ObjectKey , searchOption , maxCount , nextPageId ) . Where ( f => ! f . Name . EndsWith ( " " ) ) . ToList ( ) ; files = new EnumerableConverter < ObjectSummary , ObjectStorageFileInfo > ( metaFiles , o => new ObjectStorageFileInfo ( Client , NamespaceName , BucketName , ObjectStorageHelper . DecodeKey ( o . Name ) ) ) ; } var regEx = WildcardToRegex ( searchPattern ) ; files = files . Where ( o => Regex . IsMatch ( o . Name , regEx , RegexOptions . IgnoreCase ) ) ; return files ; }
returns files in a directory according to the specified search pattern
returns files in a directory according to the specified search pattern
None
searchPattern
string
None
searchOption
SearchOption
None
maxCount
int
nextPageId
string