/** Retrun a free port */ public static int choosePort() { return FusekiNetLib.choosePort(); }
/** Get the content type of an action or return the default. * @param action * @return ContentType */ public static ContentType getContentType(HttpAction action) { return FusekiNetLib.getContentType(action.request) ; } }
/** * <p>Choose the content media type by extracting the Accept HTTP header from * the HTTP request and choosing * (see {@link ConNeg#choose(String, AcceptList, MediaType)}) a content media * type that matches the header.</p> * * @param httpRequest HTTP request * @param myPrefs accept list * @param defaultMediaType default media type * @return media type chosen */ public static MediaType chooseContentType(HttpServletRequest httpRequest, AcceptList myPrefs, MediaType defaultMediaType) { String a = FusekiNetLib.getAccept(httpRequest) ; if ( log.isDebugEnabled() ) log.debug("Accept request: "+a) ; MediaType item = choose(a, myPrefs, defaultMediaType) ; if ( log.isDebugEnabled() ) log.debug("Content type chosen: "+item) ; return item ; }
try { if ( gn != null ) FusekiNetLib.addDataInto(dataTmp.getDefaultGraph(), action.getActiveDSG(), gn) ; else FusekiNetLib.addDataInto(dataTmp, action.getActiveDSG()) ;
static void printQueryString(PrintWriter pw, HttpServletRequest req) { Multimap<String, String> map = FusekiNetLib.parseQueryString(req) ; for ( String name : map.keys() ) for ( String value : map.get(name) ) pw.println("Param: "+name + " = " + value) ; }
String syntax = FusekiNetLib.safeParameter(httpRequest, paramSyntax) ; if ( syntax == null || syntax.equals("") ) syntax = RDFLanguages.NQUADS.getName() ;
try { if ( gn != null ) FusekiNetLib.addDataInto(dataTmp.getDefaultGraph(), action.getActiveDSG(), gn) ; else FusekiNetLib.addDataInto(dataTmp, action.getActiveDSG()) ;
static void printQueryString(PrintWriter pw, HttpServletRequest req) { Multimap<String, String> map = FusekiNetLib.parseQueryString(req) ; for ( String name : map.keys() ) for ( String value : map.get(name) ) pw.println("Param: "+name + " = " + value) ; }
String syntax = FusekiNetLib.safeParameter(httpRequest, paramSyntax) ; if ( syntax == null || syntax.equals("") ) syntax = RDFLanguages.NQUADS.getName() ;
/** Get the content type of an action or return the default. * @param action * @return ContentType */ public static ContentType getContentType(HttpAction action) { return FusekiNetLib.getContentType(action.request) ; } }
/** Retrun a free port */ public static int choosePort() { return FusekiNetLib.choosePort(); }
if ( overwrite && existedBefore ) clearGraph(target) ; FusekiNetLib.addDataInto(graphTmp, target.dsg, target.graphName) ; details.setExistedBefore(existedBefore) ; action.commit() ;
/** * <p>Choose the content media type by extracting the Accept HTTP header from * the HTTP request and choosing * (see {@link ConNeg#choose(String, AcceptList, MediaType)}) a content media * type that matches the header.</p> * * @param httpRequest HTTP request * @param myPrefs accept list * @param defaultMediaType default media type * @return media type chosen */ public static MediaType chooseContentType(HttpServletRequest httpRequest, AcceptList myPrefs, MediaType defaultMediaType) { String a = FusekiNetLib.getAccept(httpRequest) ; if ( log.isDebugEnabled() ) log.debug("Accept request: "+a) ; MediaType item = choose(a, myPrefs, defaultMediaType) ; if ( log.isDebugEnabled() ) log.debug("Content type chosen: "+item) ; return item ; }
ContentType ct = FusekiNetLib.getContentType(request) ; boolean mustHaveQueryParam = true ; if ( ct != null ) {
private static FusekiServer setup(String assembler, boolean sharedDatabase) { int port = FusekiNetLib.choosePort();
if ( overwrite && existedBefore ) clearGraph(target) ; FusekiNetLib.addDataInto(graphTmp, target.dsg, target.graphName) ; details.setExistedBefore(existedBefore) ; action.commit() ;
String x = FusekiNetLib.getAccept(request) ; String msg ; if ( x == null )
ContentType ct = FusekiNetLib.getContentType(request) ; boolean mustHaveQueryParam = true ; if ( ct != null ) {
private static FusekiServer setup(String assembler, boolean sharedDatabase) { int port = FusekiNetLib.choosePort();
if ( clearFirst ) dsg.clear() ; FusekiNetLib.addDataInto(dsgTmp, dsg) ; action.commit() ; ServletOps.success(action) ;