/** If repository cannot be contacted throws RepositoryException. */
private static void staticDetectServerDown(IOException e)
throws RepositoryException {
if (!(e instanceof SmbException))
return;
SmbException smbe = (SmbException) e;
// Not 100% sure if identifying all server downs and only server downs.
boolean badCommunication =
SmbException.NT_STATUS_UNSUCCESSFUL == smbe.getNtStatus();
Throwable rootCause = smbe.getRootCause();
String rootCauseString =
(null == rootCause) ? "" : " " + smbe.getRootCause().getClass();
boolean noTransport =
rootCause instanceof jcifs.util.transport.TransportException;
LOG.finest("server down variables:" + smbe.getNtStatus() + rootCauseString
+ " " + smbe.getMessage());
// All pipe instances are busy.
if (SmbException.NT_STATUS_INSTANCE_NOT_AVAILABLE == smbe.getNtStatus()
|| SmbException.NT_STATUS_PIPE_NOT_AVAILABLE == smbe.getNtStatus()
|| SmbException.NT_STATUS_PIPE_BUSY == smbe.getNtStatus()
|| SmbException.NT_STATUS_REQUEST_NOT_ACCEPTED == smbe.getNtStatus()) {
throw new RepositoryException("Server busy", smbe);
}
// Timeouts waiting for response.
if (badCommunication && noTransport &&