VLCLocalNetworkServiceBrowserFTP.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*****************************************************************************
  2. * VLCLocalNetworkServiceBrowserFTP.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Tobias Conradi <videolan # tobias-conradi.de>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import "VLCLocalNetworkServiceBrowserFTP.h"
  13. #import "VLCNetworkServerLoginInformation.h"
  14. @implementation VLCLocalNetworkServiceBrowserFTP
  15. - (instancetype)init {
  16. #if TARGET_OS_TV
  17. NSString *name = NSLocalizedString(@"FTP_SHORT",nil);
  18. #else
  19. NSString *name = NSLocalizedString(@"FTP_LONG",nil);
  20. #endif
  21. return [super initWithName:name
  22. serviceType:@"_ftp._tcp."
  23. domain:@""];
  24. }
  25. - (VLCLocalNetworkServiceNetService *)localServiceForNetService:(NSNetService *)netService {
  26. return [[VLCLocalNetworkServiceFTP alloc] initWithNetService:netService serviceName:self.self.name];
  27. }
  28. @end
  29. NSString *const VLCNetworkServerProtocolIdentifierFTP = @"ftp";
  30. @implementation VLCLocalNetworkServiceFTP
  31. - (UIImage *)icon {
  32. return [UIImage imageNamed:@"serverIcon"];
  33. }
  34. - (nullable id<VLCNetworkServerLoginInformation>)loginInformation
  35. {
  36. VLCNetworkServerLoginInformation *login = [[VLCNetworkServerLoginInformation alloc] init];
  37. login.address = self.netService.hostName;
  38. login.port = [NSNumber numberWithInteger:self.netService.port];
  39. login.protocolIdentifier = VLCNetworkServerProtocolIdentifierFTP;
  40. return login;
  41. }
  42. @end