new File( managedRepositoryContent.getRepoRoot(), logicalResource ).getAbsolutePath() );
}
- catch ( RepositoryAdminException e )
+ catch ( RepositoryAdminException | IOException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
}
{
managedRepositoryContent = repositoryFactory.getManagedRepositoryContent( repositoryId );
}
- catch ( RepositoryNotFoundException e )
- {
- throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
- }
catch ( RepositoryException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
{
storedExceptions.add( e );
}
- catch ( RepositoryAdminException e )
+ catch ( IOException | RepositoryAdminException e )
{
storedExceptions.add( new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e ) );
}
private DavResource processRepository( final DavServletRequest request, ArchivaDavResourceLocator archivaLocator,
String activePrincipal, ManagedRepositoryContent managedRepositoryContent,
ManagedRepository managedRepository )
- throws DavException
+ throws DavException, IOException
{
DavResource resource = null;
if ( isAuthorized( request, managedRepositoryContent.getId() ) )
}
LogicalResource logicalResource = new LogicalResource( path );
File resourceFile = new File( managedRepositoryContent.getRepoRoot(), path );
+ if(!resourceFile.getCanonicalPath().equals(resourceFile.getAbsolutePath()))
+ {
+ throw new DavException( HttpServletResponse.SC_BAD_REQUEST );
+ }
resource =
new ArchivaDavResource( resourceFile.getAbsolutePath(), path, managedRepositoryContent.getRepository(),
request.getRemoteAddr(), activePrincipal, request.getDavSession(),
}
}
- Set<String> authzRepos = new HashSet<String>();
+ Set<String> authzRepos = new HashSet<>();
String permission = WebdavMethodUtil.getMethodPermission( request.getMethod() );
temporaryGroupIndexMap );
return mergedRepoDir;
}
- catch ( RepositoryAdminException e )
- {
- throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
- }
- catch ( IndexMergerException e )
- {
- throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
- }
- catch ( IOException e )
+ catch ( RepositoryAdminException | IndexMergerException | IOException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
}