try { int c; while ((c = _in.read()) != -1) { response.append((char)c); if (response.length() >= PROMPT.length() && response.substring(response.length() - PROMPT.length(), response.length()).equals(PROMPT)) { response.setLength(response.length() - PROMPT.length()); break; } } if (_errors.length() > 0) { if (sendErrorAsResponse) { response.append(_errors); _errors.setLength(0); } else { throw new IOException(chomp(_errors).toString()); } } chomp(response); done[0] = true; } catch (IOException e) { exc[0]  = e; }
synchronized (VsftpRepository.this) { try { int c; boolean getPrompt = false;  for (int attempts = 0; !getPrompt && attempts < 5; attempts++) { while ((c = _in.read()) != -1) { attempts = 0; response.append((char)c); if (response.length() >= PROMPT.length() && response.substring(response.length() - PROMPT.length(), response.length()).equals(PROMPT)) { response.setLength(response.length() - PROMPT.length()); getPrompt = true; break; } } if (!getPrompt) { try { Thread.sleep(50); } catch (InterruptedException e) { break; } } } if (getPrompt) {  if (_errorsLastUpdateTime == 0) {  _errorsLastUpdateTime = _lastCommand; }  while ((System.currentTimeMillis() - _errorsLastUpdateTime) < 50) { try { Thread.sleep(30); } catch (InterruptedException e) { break; } } } if (_errors.length() > 0) { if (sendErrorAsResponse) { response.append(_errors); _errors.setLength(0); } else { throw new IOException(chomp(_errors).toString()); } } chomp(response); done[0] = true; } catch (IOException e) { exc[0]  = e; } finally { VsftpRepository.this.notify(); } }
			public void run() {				try {					int c;					while ((c = _in.read()) != -1) {						response.append((char)c);						if (response.length() >= PROMPT.length() 								&& response.substring(response.length() - PROMPT.length(), response.length()).equals(PROMPT)) {							response.setLength(response.length() - PROMPT.length());							break;						}					}					if (_errors.length() > 0) {						if (sendErrorAsResponse) {							response.append(_errors);							_errors.setLength(0);						} else {							throw new IOException(chomp(_errors).toString());						}					}					chomp(response);					done[0] = true;				} catch (IOException e) {					exc[0]  = e;				}						}