2006-09-02 16:09:20 +00:00
|
|
|
//
|
|
|
|
// DirectoryNode.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 8/20/2006.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "DirectoryNode.h"
|
2007-10-14 23:24:54 +00:00
|
|
|
|
2006-09-02 16:09:20 +00:00
|
|
|
#import "FileNode.h"
|
2006-09-26 22:22:56 +00:00
|
|
|
#import "SmartFolderNode.h"
|
2006-09-02 16:09:20 +00:00
|
|
|
|
2007-10-14 23:24:54 +00:00
|
|
|
@implementation DirectoryNode
|
2006-09-02 16:09:20 +00:00
|
|
|
|
|
|
|
- (BOOL)isLeaf
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2007-10-15 03:29:30 +00:00
|
|
|
- (void)updatePath
|
2006-09-26 22:22:56 +00:00
|
|
|
{
|
2013-10-03 08:00:58 +00:00
|
|
|
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url includingPropertiesForKeys:[NSArray arrayWithObjects:NSURLNameKey, NSURLIsDirectoryKey, nil] options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:^BOOL(NSURL *url, NSError *error) {
|
|
|
|
return NO;
|
|
|
|
}];
|
2007-10-15 23:18:58 +00:00
|
|
|
NSMutableArray *fullPaths = [[NSMutableArray alloc] init];
|
2008-02-20 00:54:45 +00:00
|
|
|
|
2013-10-03 08:00:58 +00:00
|
|
|
for (NSURL * theUrl in enumerator)
|
2007-10-15 23:18:58 +00:00
|
|
|
{
|
2013-10-03 08:00:58 +00:00
|
|
|
[fullPaths addObject:[theUrl path]];
|
2007-10-15 23:18:58 +00:00
|
|
|
}
|
2007-10-15 03:29:30 +00:00
|
|
|
|
2007-10-15 23:18:58 +00:00
|
|
|
[self processPaths: fullPaths];
|
|
|
|
|
|
|
|
[fullPaths release];
|
2006-09-02 16:09:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|