in commons-transfer/commons-transfer-http/src/main/java/org/apache/archiva/commons/transfer/http/HttpTransferBase.java [226:287]
public boolean isWebDavCapableServer()
{
OptionsMethod method = new OptionsMethod( baseuri.toASCIIString() );
try
{
int status = client.executeMethod( method );
if ( status == HttpStatus.SC_OK )
{
// Test DAV Header Options
boolean supportsDav1 = false;
Header davOptionHeader = method.getResponseHeader( "dav" );
if ( davOptionHeader != null )
{
String davSupport[] = StringUtils.split( davOptionHeader.getValue(), "," );
for ( String support : davSupport )
{
support = support.trim();
if ( "1".equals( support ) )
{
supportsDav1 = true;
}
}
}
if ( !supportsDav1 )
{
LOG.info( "No DAV Support: " + baseuri.toASCIIString() );
return false;
}
// Not validate.
String requiredMethods[] = new String[] { "HEAD", "GET", "MKCOL", "PROPFIND", "PUT", "OPTIONS" };
boolean supportsRequired = true;
for ( String required : requiredMethods )
{
if ( !method.isAllowed( required ) )
{
LOG.info( "No " + required + " Support: " + baseuri.toASCIIString() );
supportsRequired = false;
}
}
return supportsRequired;
}
}
catch ( HttpException e )
{
LOG.info( "Unable to get OPTIONS from " + baseuri.toASCIIString(), e );
}
catch ( IOException e )
{
LOG.info( "Unable to get OPTIONS from " + baseuri.toASCIIString(), e );
}
finally
{
method.releaseConnection();
}
return false;
}