public class PolyglotRESTUtilities extends Object
Constructor and Description |
---|
PolyglotRESTUtilities() |
Modifier and Type | Method and Description |
---|---|
static String |
getForm(Polyglot polyglot,
boolean POST_UPLOADS,
String selected_output)
Get a web form interface for this restful service.
|
static String |
toString(Collection<String> strings)
Convert a Collection of strings to a line separated list of strings.
|
static String |
truncateFileName(int prefixId,
String filepath)
Truncate filename from the leftmost filename to a reasonable length,
so caller can put length of prefix (maximum FILENAME_PREFIX_RESERVED_LENGTH) before the truncated filename and DOT_LOG_EXTENSION_LENGTH length
as a new extension.
|
static String |
truncateFileName(String filepath)
Truncate filename to a reasonable length.
|
static String |
truncateURLFileName(String filepath)
truncate URL filename to a reasonable length.
|
static void |
updateMongo(com.mongodb.DB db,
Polyglot polyglot)
Push logged information to mongo.
|
static void |
updateMongo(com.mongodb.DB db,
PolyglotAuxiliary.RequestInformation request)
Push request information to mongo.
|
public static String truncateFileName(String filepath)
filepath
- full path of filepublic static String truncateURLFileName(String filepath)
filepath
- full path of filepublic static String truncateFileName(int prefixId, String filepath)
prefixId
- if sessionid or jobid >= 1, then add such id as prefix of truncated filename, otherwise not.filepath
- full path of filepublic static String getForm(Polyglot polyglot, boolean POST_UPLOADS, String selected_output)
polylgot
- the polyglot stewardPOST_UPLOADS
- true if this form should use POST rather than GET for uploading filesselected_output
- the default output formatpublic static void updateMongo(com.mongodb.DB db, Polyglot polyglot)
db
- a mongo databasepolyglot
- the polyglot stewardpublic static void updateMongo(com.mongodb.DB db, PolyglotAuxiliary.RequestInformation request)
db
- a mongo databasepublic static String toString(Collection<String> strings)
strings
- a Collection of stringsCopyright © 2021. All rights reserved.