@ GET @ Produces ( MediaType . APPLICATION_JSON ) @ RolesAllowed ( "administrators" ) @ Path ( "/default-ws-config/{repositoryName}" ) public Response getDefaultWorkspaceConfig ( @ PathParam ( "repositoryName" ) String repositoryName ) { String errorMessage = new String ( ) ; Status status ; try { String defaultWorkspaceName = repositoryService . getRepository ( repositoryName ) . getConfiguration ( ) . getDefaultWorkspaceName ( ) ; for ( WorkspaceEntry wEntry : repositoryService . getRepository ( repositoryName ) . getConfiguration ( ) . getWorkspaceEntries ( ) ) { if ( defaultWorkspaceName . equals ( wEntry . getName ( ) ) ) { return Response . ok ( wEntry ) . cacheControl ( NO_CACHE ) . build ( ) ; } } return Response . status ( Response . Status . NOT_FOUND ) . entity ( "Can not get default workspace configuration." ) . type ( MediaType . TEXT_PLAIN ) . cacheControl ( NO_CACHE ) . build ( ) ; } catch ( RepositoryException e ) { if ( log . isDebugEnabled ( ) ) { log . error ( e . getMessage ( ) , e ) ; } errorMessage = e . getMessage ( ) ; status = Status . NOT_FOUND ; } catch ( Throwable e ) //NOSONAR { if ( log . isDebugEnabled ( ) ) { log . error ( e . getMessage ( ) , e ) ; } errorMessage = e . getMessage ( ) ; status = Status . INTERNAL_SERVER_ERROR ; } return Response . status ( status ) . entity ( errorMessage ) . type ( MediaType . TEXT_PLAIN_TYPE ) . cacheControl ( NO_CACHE ) . build ( ) ; }
Gives the configuration of the default workspace of the given repository