public void CommitWrite() { try { Android.Util.Log.Debug("NETFTP", "connected: " + _client.IsConnected.ToString()); _stream.Close(); _client.GetReply(); Android.Util.Log.Debug("NETFTP", "connected: " + _client.IsConnected.ToString()); //make sure target file does not exist: //try { if (_client.FileExists(NetFtpFileStorage.IocToLocalPath(_ioc))) { _client.DeleteFile(NetFtpFileStorage.IocToLocalPath(_ioc)); } } //catch (FtpCommandException) { //TODO get a new clien? might be stale } _client.Rename(NetFtpFileStorage.IocToLocalPath(_iocTemp), NetFtpFileStorage.IocToLocalPath(_ioc)); } catch (FtpCommandException ex) { throw NetFtpFileStorage.ConvertException(ex); } }
public Stream OpenFile() { try { _client = _fileStorage.GetClient(_ioc, false); _stream = _client.OpenWrite(NetFtpFileStorage.IocToLocalPath(_iocTemp)); return(_stream); } catch (FtpCommandException ex) { throw NetFtpFileStorage.ConvertException(ex); } }
public void CommitWrite() { try { Android.Util.Log.Debug("NETFTP", "connected: " + _client.IsConnected.ToString()); _stream.Close(); _stream.Dispose(); _client.GetReply(); _client.MoveFile(NetFtpFileStorage.IocToLocalPath(_iocTemp), NetFtpFileStorage.IocToLocalPath(_ioc)); } catch (FtpCommandException ex) { throw NetFtpFileStorage.ConvertException(ex); } }