![JAR search and dependency download from the Maven repository](/logo.png)
net.java.trueupdate.jaxrs.server.UpdateServers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trueupdate-jaxrs-server Show documentation
Show all versions of trueupdate-jaxrs-server Show documentation
Provides a RESTful web service implementation for artifact updates.
The newest version!
/*
* Copyright (C) 2013 Schlichtherle IT Services & Stimulus Software.
* All rights reserved. Use is subject to license terms.
*/
package net.java.trueupdate.jaxrs.server;
import java.util.concurrent.Callable;
import net.java.trueupdate.jaxrs.util.UpdateServiceException;
/**
* Utility functions for update servers.
*
* @see AbstractUpdateServer
* @see ConfiguredUpdateServer
* @author Christian Schlichtherle
*/
final class UpdateServers {
private static final int BAD_REQUEST = 400, NOT_FOUND = 404;
private UpdateServers() { }
static V wrap(final Callable task)
throws UpdateServiceException {
try {
return task.call();
} catch (UpdateServiceException ex) {
throw ex;
} catch (RuntimeException ex) {
throw new UpdateServiceException(BAD_REQUEST, ex);
} catch (Exception ex) {
throw new UpdateServiceException(NOT_FOUND, ex);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy