parent
264736422f
commit
43b547e044
|
|
@ -53,7 +53,6 @@ import java.util.stream.Stream;
|
|||
*
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SystemInformation {
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ public class AdminApi extends Application {
|
|||
classes.add(RolesApi.class);
|
||||
classes.add(UsersApi.class);
|
||||
|
||||
// System Information API
|
||||
classes.add(SystemInformationApi.class);
|
||||
|
||||
return classes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (C) 2020 LibreCCM Foundation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
package org.libreccm.api.admin;
|
||||
|
||||
import com.arsdigita.util.SystemInformation;
|
||||
|
||||
import org.libreccm.core.CoreConstants;
|
||||
import org.libreccm.security.AuthorizationRequired;
|
||||
import org.libreccm.security.RequiresPrivilege;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.transaction.Transactional;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@RequestScoped
|
||||
@Path("/systeminformation")
|
||||
public class SystemInformationApi {
|
||||
|
||||
@GET
|
||||
@Path("/{domainIdentifier}/{path:^[\\w\\-/]+$}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@AuthorizationRequired
|
||||
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public SystemInformation getSystemInformation() {
|
||||
return SystemInformation.getInstance();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue