Skip to content

Commit

Permalink
Cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-David Gadina committed Feb 20, 2012
1 parent 183d5e7 commit 03b0ac5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions EOSFTPServer/FTPServer/Classes/EOSFTPServer+Private.m
Expand Up @@ -52,39 +52,39 @@ - ( void )unrecognizedCommand: ( NSString * )command connection: ( EOSFTPServerC

- ( NSString * )directoryListingForConnection: ( EOSFTPServerConnection * )connection path: ( NSString * )path
{
EOSFile * directory;
NSDateFormatter * dateFormatter;
NSLocale * locale;
NSDirectoryEnumerator * enumerator;
NSMutableArray * listing;
NSString * absolutePath;
NSString * filePath;
NSUInteger subFilesCount;
EOSFile * file;
NSString * fileInfos;

absolutePath = [ self absolutePathForConnection: connection subPath: path ];
directory = [ self fileAtPath: path connection: connection ];

if( absolutePath == nil )
if( directory == nil )
{
return nil;
}

dateFormatter = [ NSDateFormatter new ];
locale = [ [ NSLocale alloc ] initWithLocaleIdentifier: @"en" ];
enumerator = [ [ NSFileManager defaultManager ] enumeratorAtPath: absolutePath ];
enumerator = [ [ NSFileManager defaultManager ] enumeratorAtPath: directory.path ];
listing = [ NSMutableArray arrayWithCapacity: 100 ];

[ dateFormatter setDateFormat: @"MMM dd HH:mm" ];
[ dateFormatter setLocale: locale ];
[ locale release ];

EOS_FTP_DEBUG( @"Listing directory: %@", absolutePath );
EOS_FTP_DEBUG( @"Listing directory: %@", directory.path );

while( ( filePath = [ enumerator nextObject ] ) )
{
[ enumerator skipDescendents ];

filePath = [ absolutePath stringByAppendingPathComponent: filePath ];
filePath = [ directory.path stringByAppendingPathComponent: filePath ];
file = [ EOSFile fileWithPath: filePath ];

if( file == nil )
Expand All @@ -104,7 +104,7 @@ - ( NSString * )directoryListingForConnection: ( EOSFTPServerConnection * )conne
file.group,
file.bytes,
[ dateFormatter stringFromDate: file.modificationDate ],
[ self serverPathForConnection: connection subPath: filePath ]
[ [ self serverPathForFile: file ] lastPathComponent ]
];

[ listing addObject: fileInfos ];
Expand Down

0 comments on commit 03b0ac5

Please sign in to comment.