The base class for items returned by a ListObjectsRequest. The only two concrete subclasses are ObjectEntry and CommonPrefix.
 public RepositoryItem CreateObjectInstance(ListEntry s3item)
 {
     string key = Key (s3item);
     if (key != string.Empty) {
         RepositoryItem item = RepositoryItem.CreateInstance (repo, s3item);
         return item;
     }
     return null;
 }
 private void DeleteEntry(ListEntry entry)
 {
     if(Key(entry) != string.Empty){
         if (entry is CommonPrefix) {
             GenericDelete (Key(entry), true);
         } else {
             connection.Connect ().DeleteObject (RuntimeSettings.DefaultBucketName, Key(entry));
         }
     }
 }
 private string Key(ListEntry s3item)
 {
     string key = string.Empty;
     if (s3item is CommonPrefix) {
         key = ((CommonPrefix)s3item).Prefix;
     } else {
         key = ((ObjectEntry)s3item).Key;
     }
     return key;
 }
Esempio n. 4
0
        public static RepositoryItem CreateInstance(LocalRepository repo, ListEntry entry)
        {
            RepositoryItem item = new RepositoryItem(repo);
            string key = "";
            if (entry is CommonPrefix) {
                key = ((CommonPrefix)entry).Prefix;
            } else {
                key = ((ObjectEntry)entry).Key;
            }
            item.Key = key;
            item.LocalETag = null;
            item.IsFolder = key.EndsWith("/");

            if(dao.ExistsUnmoved(item)){
                item = dao.GetFomDatabase (item);
            }
            return item;
        }