Cog/FileTree/DirectoryNode.m

37 lines
947 B
Mathematica
Raw Normal View History

2006-09-02 12:09:20 -04:00
//
// DirectoryNode.m
// Cog
//
// Created by Vincent Spader on 8/20/2006.
// Copyright 2006 Vincent Spader. All rights reserved.
//
#import "DirectoryNode.h"
2006-09-02 12:09:20 -04:00
#import "FileNode.h"
#import "SmartFolderNode.h"
2006-09-02 12:09:20 -04:00
@implementation DirectoryNode
2006-09-02 12:09:20 -04:00
- (BOOL)isLeaf
{
return NO;
}
- (void)updatePath
{
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 20:18:58 -03:00
NSMutableArray *fullPaths = [[NSMutableArray alloc] init];
for (NSURL * theUrl in enumerator)
2007-10-15 20:18:58 -03:00
{
[fullPaths addObject:[theUrl path]];
2007-10-15 20:18:58 -03:00
}
2013-10-09 15:29:59 -03:00
[self processPaths: [fullPaths sortedArrayUsingSelector:@selector(finderCompare:)]];
2006-09-02 12:09:20 -04:00
}
@end