id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
103,500
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java
OdsElements.writeMeta
public void writeMeta(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.logger.log(Level.FINER, "Writing odselement: metaElement to zip file"); this.metaElement.write(xmlUtil, writer); }
java
public void writeMeta(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.logger.log(Level.FINER, "Writing odselement: metaElement to zip file"); this.metaElement.write(xmlUtil, writer); }
[ "public", "void", "writeMeta", "(", "final", "XMLUtil", "xmlUtil", ",", "final", "ZipUTF8Writer", "writer", ")", "throws", "IOException", "{", "this", ".", "logger", ".", "log", "(", "Level", ".", "FINER", ",", "\"Writing odselement: metaElement to zip file\"", ")...
Write the meta element to a writer. @param xmlUtil the xml util @param writer the writer @throws IOException if write fails
[ "Write", "the", "meta", "element", "to", "a", "writer", "." ]
a034d173083ffa602dc525699b97f753082eaef9
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L399-L402
103,501
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java
OdsElements.writeSettings
public void writeSettings(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.settingsElement.setTables(this.getTables()); this.logger.log(Level.FINER, "Writing odselement: settingsElement to zip file"); this.settingsElement.write(xmlUtil, writer); }
java
public void writeSettings(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.settingsElement.setTables(this.getTables()); this.logger.log(Level.FINER, "Writing odselement: settingsElement to zip file"); this.settingsElement.write(xmlUtil, writer); }
[ "public", "void", "writeSettings", "(", "final", "XMLUtil", "xmlUtil", ",", "final", "ZipUTF8Writer", "writer", ")", "throws", "IOException", "{", "this", ".", "settingsElement", ".", "setTables", "(", "this", ".", "getTables", "(", ")", ")", ";", "this", "....
Write the settings element to a writer. @param xmlUtil the xml util @param writer the writer @throws IOException if write fails
[ "Write", "the", "settings", "element", "to", "a", "writer", "." ]
a034d173083ffa602dc525699b97f753082eaef9
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L411-L415
103,502
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java
OdsElements.writeStyles
public void writeStyles(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.logger.log(Level.FINER, "Writing odselement: stylesElement to zip file"); this.stylesElement.write(xmlUtil, writer); }
java
public void writeStyles(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.logger.log(Level.FINER, "Writing odselement: stylesElement to zip file"); this.stylesElement.write(xmlUtil, writer); }
[ "public", "void", "writeStyles", "(", "final", "XMLUtil", "xmlUtil", ",", "final", "ZipUTF8Writer", "writer", ")", "throws", "IOException", "{", "this", ".", "logger", ".", "log", "(", "Level", ".", "FINER", ",", "\"Writing odselement: stylesElement to zip file\"", ...
Write the styles element to a writer. @param xmlUtil the xml util @param writer the writer @throws IOException if write fails
[ "Write", "the", "styles", "element", "to", "a", "writer", "." ]
a034d173083ffa602dc525699b97f753082eaef9
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L424-L427
103,503
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/TableAppender.java
TableAppender.appendPreamble
public void appendPreamble(final XMLUtil util, final Appendable appendable) throws IOException { if (this.preambleWritten) return; appendable.append("<table:table"); util.appendEAttribute(appendable, "table:name", this.builder.getName()); util.appendEAttribute(appendable, "t...
java
public void appendPreamble(final XMLUtil util, final Appendable appendable) throws IOException { if (this.preambleWritten) return; appendable.append("<table:table"); util.appendEAttribute(appendable, "table:name", this.builder.getName()); util.appendEAttribute(appendable, "t...
[ "public", "void", "appendPreamble", "(", "final", "XMLUtil", "util", ",", "final", "Appendable", "appendable", ")", "throws", "IOException", "{", "if", "(", "this", ".", "preambleWritten", ")", "return", ";", "appendable", ".", "append", "(", "\"<table:table\"",...
Append the preamble @param util an util @param appendable the destination @throws IOException if an I/O error occurs
[ "Append", "the", "preamble" ]
a034d173083ffa602dc525699b97f753082eaef9
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableAppender.java#L68-L83
103,504
eBay/xcelite
src/main/java/com/ebay/xcelite/Xcelite.java
Xcelite.getSheet
public XceliteSheet getSheet(int sheetIndex) { Sheet sheet = workbook.getSheetAt(sheetIndex); if (sheet == null) { throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex)); } return new XceliteSheetImpl(sheet, file); }
java
public XceliteSheet getSheet(int sheetIndex) { Sheet sheet = workbook.getSheetAt(sheetIndex); if (sheet == null) { throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex)); } return new XceliteSheetImpl(sheet, file); }
[ "public", "XceliteSheet", "getSheet", "(", "int", "sheetIndex", ")", "{", "Sheet", "sheet", "=", "workbook", ".", "getSheetAt", "(", "sheetIndex", ")", ";", "if", "(", "sheet", "==", "null", ")", "{", "throw", "new", "XceliteException", "(", "String", ".",...
Gets the sheet at the specified index. @param sheetIndex the sheet index @return XceliteSheet object
[ "Gets", "the", "sheet", "at", "the", "specified", "index", "." ]
0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1
https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L85-L91
103,505
eBay/xcelite
src/main/java/com/ebay/xcelite/Xcelite.java
Xcelite.getSheet
public XceliteSheet getSheet(String sheetName) { Sheet sheet = workbook.getSheet(sheetName); if (sheet == null) { throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName)); } return new XceliteSheetImpl(sheet, file); }
java
public XceliteSheet getSheet(String sheetName) { Sheet sheet = workbook.getSheet(sheetName); if (sheet == null) { throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName)); } return new XceliteSheetImpl(sheet, file); }
[ "public", "XceliteSheet", "getSheet", "(", "String", "sheetName", ")", "{", "Sheet", "sheet", "=", "workbook", ".", "getSheet", "(", "sheetName", ")", ";", "if", "(", "sheet", "==", "null", ")", "{", "throw", "new", "XceliteException", "(", "String", ".", ...
Gets the sheet with the specified index. @param sheetIndex the sheet name @return XceliteSheet object
[ "Gets", "the", "sheet", "with", "the", "specified", "index", "." ]
0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1
https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L99-L105
103,506
eBay/xcelite
src/main/java/com/ebay/xcelite/Xcelite.java
Xcelite.write
public void write(File file) { FileOutputStream out = null; try { out = new FileOutputStream(file, false); workbook.write(out); } catch (FileNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { new RuntimeException(e); } finally { if...
java
public void write(File file) { FileOutputStream out = null; try { out = new FileOutputStream(file, false); workbook.write(out); } catch (FileNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { new RuntimeException(e); } finally { if...
[ "public", "void", "write", "(", "File", "file", ")", "{", "FileOutputStream", "out", "=", "null", ";", "try", "{", "out", "=", "new", "FileOutputStream", "(", "file", ",", "false", ")", ";", "workbook", ".", "write", "(", "out", ")", ";", "}", "catch...
Saves data to a new file. @param file the file to save the data into
[ "Saves", "data", "to", "a", "new", "file", "." ]
0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1
https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L123-L140
103,507
eBay/xcelite
src/main/java/com/ebay/xcelite/Xcelite.java
Xcelite.getBytes
public byte[] getBytes() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { workbook.write(baos); } catch (IOException e) { new RuntimeException(e); } finally { if (baos != null) try { baos.close(); } catch (IOException e) { ...
java
public byte[] getBytes() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { workbook.write(baos); } catch (IOException e) { new RuntimeException(e); } finally { if (baos != null) try { baos.close(); } catch (IOException e) { ...
[ "public", "byte", "[", "]", "getBytes", "(", ")", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "try", "{", "workbook", ".", "write", "(", "baos", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "n...
Gets the excel file as byte array. @return byte array which represents the excel file
[ "Gets", "the", "excel", "file", "as", "byte", "array", "." ]
0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1
https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L147-L162
103,508
EsotericSoftware/minlog
src/com/esotericsoftware/minlog/Log.java
Log.set
static public void set (int level) { // Comment out method contents when compiling fixed level JARs. Log.level = level; ERROR = level <= LEVEL_ERROR; WARN = level <= LEVEL_WARN; INFO = level <= LEVEL_INFO; DEBUG = level <= LEVEL_DEBUG; TRACE = level <= LEVEL_TRACE; }
java
static public void set (int level) { // Comment out method contents when compiling fixed level JARs. Log.level = level; ERROR = level <= LEVEL_ERROR; WARN = level <= LEVEL_WARN; INFO = level <= LEVEL_INFO; DEBUG = level <= LEVEL_DEBUG; TRACE = level <= LEVEL_TRACE; }
[ "static", "public", "void", "set", "(", "int", "level", ")", "{", "// Comment out method contents when compiling fixed level JARs.\r", "Log", ".", "level", "=", "level", ";", "ERROR", "=", "level", "<=", "LEVEL_ERROR", ";", "WARN", "=", "level", "<=", "LEVEL_WARN"...
Sets the level to log. If a version of this class is being used that has a final log level, this has no affect.
[ "Sets", "the", "level", "to", "log", ".", "If", "a", "version", "of", "this", "class", "is", "being", "used", "that", "has", "a", "final", "log", "level", "this", "has", "no", "affect", "." ]
5906ffcd6efdb3dcd27e84621cb80ccc8a698176
https://github.com/EsotericSoftware/minlog/blob/5906ffcd6efdb3dcd27e84621cb80ccc8a698176/src/com/esotericsoftware/minlog/Log.java#L39-L47
103,509
hgoebl/DavidWebb
src/main/java/com/goebl/david/WebbUtils.java
WebbUtils.queryString
public static String queryString(Map<String, Object> values) { StringBuilder sbuf = new StringBuilder(); String separator = ""; for (Map.Entry<String, Object> entry : values.entrySet()) { Object entryValue = entry.getValue(); if (entryValue instanceof Object[]) { ...
java
public static String queryString(Map<String, Object> values) { StringBuilder sbuf = new StringBuilder(); String separator = ""; for (Map.Entry<String, Object> entry : values.entrySet()) { Object entryValue = entry.getValue(); if (entryValue instanceof Object[]) { ...
[ "public", "static", "String", "queryString", "(", "Map", "<", "String", ",", "Object", ">", "values", ")", "{", "StringBuilder", "sbuf", "=", "new", "StringBuilder", "(", ")", ";", "String", "separator", "=", "\"\"", ";", "for", "(", "Map", ".", "Entry",...
Convert a Map to a query string. @param values the map with the values <code>null</code> will be encoded as empty string, all other objects are converted to String by calling its <code>toString()</code> method. @return e.g. "key1=value&amp;key2=&amp;email=max%40example.com"
[ "Convert", "a", "Map", "to", "a", "query", "string", "." ]
4f1532fbc3d817886d38de24eacc02b44b910b42
https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/WebbUtils.java#L43-L66
103,510
hgoebl/DavidWebb
src/main/java/com/goebl/david/WebbUtils.java
WebbUtils.toJsonObject
public static JSONObject toJsonObject(byte[] bytes) { String json; try { json = new String(bytes, Const.UTF8); return new JSONObject(json); } catch (UnsupportedEncodingException e) { throw new WebbException(e); } catch (JSONException e) { t...
java
public static JSONObject toJsonObject(byte[] bytes) { String json; try { json = new String(bytes, Const.UTF8); return new JSONObject(json); } catch (UnsupportedEncodingException e) { throw new WebbException(e); } catch (JSONException e) { t...
[ "public", "static", "JSONObject", "toJsonObject", "(", "byte", "[", "]", "bytes", ")", "{", "String", "json", ";", "try", "{", "json", "=", "new", "String", "(", "bytes", ",", "Const", ".", "UTF8", ")", ";", "return", "new", "JSONObject", "(", "json", ...
Convert a byte array to a JSONObject. @param bytes a UTF-8 encoded string representing a JSON object. @return the parsed object @throws WebbException in case of error (usually a parsing error due to invalid JSON)
[ "Convert", "a", "byte", "array", "to", "a", "JSONObject", "." ]
4f1532fbc3d817886d38de24eacc02b44b910b42
https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/WebbUtils.java#L82-L92
103,511
hgoebl/DavidWebb
src/main/java/com/goebl/david/WebbUtils.java
WebbUtils.toJsonArray
public static JSONArray toJsonArray(byte[] bytes) { String json; try { json = new String(bytes, Const.UTF8); return new JSONArray(json); } catch (UnsupportedEncodingException e) { throw new WebbException(e); } catch (JSONException e) { thro...
java
public static JSONArray toJsonArray(byte[] bytes) { String json; try { json = new String(bytes, Const.UTF8); return new JSONArray(json); } catch (UnsupportedEncodingException e) { throw new WebbException(e); } catch (JSONException e) { thro...
[ "public", "static", "JSONArray", "toJsonArray", "(", "byte", "[", "]", "bytes", ")", "{", "String", "json", ";", "try", "{", "json", "=", "new", "String", "(", "bytes", ",", "Const", ".", "UTF8", ")", ";", "return", "new", "JSONArray", "(", "json", "...
Convert a byte array to a JSONArray. @param bytes a UTF-8 encoded string representing a JSON array. @return the parsed JSON array @throws WebbException in case of error (usually a parsing error due to invalid JSON)
[ "Convert", "a", "byte", "array", "to", "a", "JSONArray", "." ]
4f1532fbc3d817886d38de24eacc02b44b910b42
https://github.com/hgoebl/DavidWebb/blob/4f1532fbc3d817886d38de24eacc02b44b910b42/src/main/java/com/goebl/david/WebbUtils.java#L100-L110
103,512
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/handler/FileHandler.java
FileHandler.sendStream
private void sendStream(InputStream in) { new Thread(() -> { try { con.sendData(in); con.sendResponse(226, "File sent!"); } catch(ResponseException ex) { con.sendResponse(ex.getCode(), ex.getMessage()); } catch(Exception ex) { ...
java
private void sendStream(InputStream in) { new Thread(() -> { try { con.sendData(in); con.sendResponse(226, "File sent!"); } catch(ResponseException ex) { con.sendResponse(ex.getCode(), ex.getMessage()); } catch(Exception ex) { ...
[ "private", "void", "sendStream", "(", "InputStream", "in", ")", "{", "new", "Thread", "(", "(", ")", "->", "{", "try", "{", "con", ".", "sendData", "(", "in", ")", ";", "con", ".", "sendResponse", "(", "226", ",", "\"File sent!\"", ")", ";", "}", "...
Sends a stream asynchronously, sending a response after it's done @param in The stream
[ "Sends", "a", "stream", "asynchronously", "sending", "a", "response", "after", "it", "s", "done" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/handler/FileHandler.java#L461-L472
103,513
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/handler/FileHandler.java
FileHandler.receiveStream
private void receiveStream(OutputStream out) { new Thread(() -> { try { con.receiveData(out); con.sendResponse(226, "File received!"); } catch(ResponseException ex) { con.sendResponse(ex.getCode(), ex.getMessage()); } catch(Exce...
java
private void receiveStream(OutputStream out) { new Thread(() -> { try { con.receiveData(out); con.sendResponse(226, "File received!"); } catch(ResponseException ex) { con.sendResponse(ex.getCode(), ex.getMessage()); } catch(Exce...
[ "private", "void", "receiveStream", "(", "OutputStream", "out", ")", "{", "new", "Thread", "(", "(", ")", "->", "{", "try", "{", "con", ".", "receiveData", "(", "out", ")", ";", "con", ".", "sendResponse", "(", "226", ",", "\"File received!\"", ")", ";...
Receives a stream asynchronously, sending a response after it's done @param out The stream
[ "Receives", "a", "stream", "asynchronously", "sending", "a", "response", "after", "it", "s", "done" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/handler/FileHandler.java#L478-L489
103,514
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.listen
public void listen(InetAddress address, int port) throws IOException { if(auth == null) throw new NullPointerException("The Authenticator is null"); if(socket != null) throw new IOException("Server already started"); socket = Utils.createServer(port, 50, address, ssl, !explicitSecurity); ...
java
public void listen(InetAddress address, int port) throws IOException { if(auth == null) throw new NullPointerException("The Authenticator is null"); if(socket != null) throw new IOException("Server already started"); socket = Utils.createServer(port, 50, address, ssl, !explicitSecurity); ...
[ "public", "void", "listen", "(", "InetAddress", "address", ",", "int", "port", ")", "throws", "IOException", "{", "if", "(", "auth", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"The Authenticator is null\"", ")", ";", "if", "(", "socket",...
Starts the FTP server asynchronously. @param address The server address or {@code null} for a local address @param port The server port or {@code 0} to automatically allocate the port @throws IOException When an error occurs while starting the server
[ "Starts", "the", "FTP", "server", "asynchronously", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L197-L206
103,515
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.listenSync
public void listenSync(InetAddress address, int port) throws IOException { if(auth == null) throw new NullPointerException("The Authenticator is null"); if(socket != null) throw new IOException("Server already started"); socket = Utils.createServer(port, 50, address, ssl, !explicitSecurity); ...
java
public void listenSync(InetAddress address, int port) throws IOException { if(auth == null) throw new NullPointerException("The Authenticator is null"); if(socket != null) throw new IOException("Server already started"); socket = Utils.createServer(port, 50, address, ssl, !explicitSecurity); ...
[ "public", "void", "listenSync", "(", "InetAddress", "address", ",", "int", "port", ")", "throws", "IOException", "{", "if", "(", "auth", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"The Authenticator is null\"", ")", ";", "if", "(", "sock...
Starts the FTP server synchronously, blocking the current thread. Connections to the server will still create new threads. @param address The server address or {@code null} for a local address @param port The server port or {@code 0} to automatically allocate the port @throws IOException When an error occurs while st...
[ "Starts", "the", "FTP", "server", "synchronously", "blocking", "the", "current", "thread", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L229-L238
103,516
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.addConnection
protected void addConnection(Socket socket) throws IOException { FTPConnection con = createConnection(socket); synchronized(listeners) { for(IFTPListener l : listeners) { l.onConnected(con); } } synchronized(connections) { connections....
java
protected void addConnection(Socket socket) throws IOException { FTPConnection con = createConnection(socket); synchronized(listeners) { for(IFTPListener l : listeners) { l.onConnected(con); } } synchronized(connections) { connections....
[ "protected", "void", "addConnection", "(", "Socket", "socket", ")", "throws", "IOException", "{", "FTPConnection", "con", "=", "createConnection", "(", "socket", ")", ";", "synchronized", "(", "listeners", ")", "{", "for", "(", "IFTPListener", "l", ":", "liste...
Called when a connection is created. @param socket The connection socket @throws IOException When an error occurs
[ "Called", "when", "a", "connection", "is", "created", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L270-L281
103,517
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.removeConnection
protected void removeConnection(FTPConnection con) throws IOException { synchronized(listeners) { for(IFTPListener l : listeners) { l.onDisconnected(con); } } synchronized(connections) { connections.remove(con); } }
java
protected void removeConnection(FTPConnection con) throws IOException { synchronized(listeners) { for(IFTPListener l : listeners) { l.onDisconnected(con); } } synchronized(connections) { connections.remove(con); } }
[ "protected", "void", "removeConnection", "(", "FTPConnection", "con", ")", "throws", "IOException", "{", "synchronized", "(", "listeners", ")", "{", "for", "(", "IFTPListener", "l", ":", "listeners", ")", "{", "l", ".", "onDisconnected", "(", "con", ")", ";"...
Called when a connection is terminated @param con The FTP connection @throws IOException When an error occurs
[ "Called", "when", "a", "connection", "is", "terminated" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L288-L297
103,518
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.dispose
protected void dispose() { // Terminates the server thread if(serverThread != null) { serverThread.interrupt(); serverThread = null; } // Stops each connection and clears them synchronized(connections) { for(FTPConnection con : connections) { ...
java
protected void dispose() { // Terminates the server thread if(serverThread != null) { serverThread.interrupt(); serverThread = null; } // Stops each connection and clears them synchronized(connections) { for(FTPConnection con : connections) { ...
[ "protected", "void", "dispose", "(", ")", "{", "// Terminates the server thread", "if", "(", "serverThread", "!=", "null", ")", "{", "serverThread", ".", "interrupt", "(", ")", ";", "serverThread", "=", "null", ";", "}", "// Stops each connection and clears them", ...
Starts disposing server resources. For a complete cleanup, use {@link #close()} instead
[ "Starts", "disposing", "server", "resources", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L304-L322
103,519
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPServer.java
FTPServer.close
@Override public void close() throws IOException { dispose(); if(socket != null) { socket.close(); socket = null; } }
java
@Override public void close() throws IOException { dispose(); if(socket != null) { socket.close(); socket = null; } }
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "IOException", "{", "dispose", "(", ")", ";", "if", "(", "socket", "!=", "null", ")", "{", "socket", ".", "close", "(", ")", ";", "socket", "=", "null", ";", "}", "}" ]
Stops the server and dispose its resources. @throws IOException When an I/O error occurs
[ "Stops", "the", "server", "and", "dispose", "its", "resources", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPServer.java#L328-L336
103,520
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.sendResponse
public void sendResponse(int code, String response) { if(con.isClosed()) return; if(response == null || response.isEmpty()) { response = "Unknown"; } try { if(response.charAt(0) == '-') { writer.write(code + response + "\r\n"); } else...
java
public void sendResponse(int code, String response) { if(con.isClosed()) return; if(response == null || response.isEmpty()) { response = "Unknown"; } try { if(response.charAt(0) == '-') { writer.write(code + response + "\r\n"); } else...
[ "public", "void", "sendResponse", "(", "int", "code", ",", "String", "response", ")", "{", "if", "(", "con", ".", "isClosed", "(", ")", ")", "return", ";", "if", "(", "response", "==", "null", "||", "response", ".", "isEmpty", "(", ")", ")", "{", "...
Sends a response to the connection @param code The response code @param response The response message
[ "Sends", "a", "response", "to", "the", "connection" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L211-L229
103,521
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.sendData
public void sendData(byte[] data) throws ResponseException { if(con.isClosed()) return; Socket socket = null; try { socket = conHandler.createDataSocket(); dataConnections.add(socket); OutputStream out = socket.getOutputStream(); Utils.write(out,...
java
public void sendData(byte[] data) throws ResponseException { if(con.isClosed()) return; Socket socket = null; try { socket = conHandler.createDataSocket(); dataConnections.add(socket); OutputStream out = socket.getOutputStream(); Utils.write(out,...
[ "public", "void", "sendData", "(", "byte", "[", "]", "data", ")", "throws", "ResponseException", "{", "if", "(", "con", ".", "isClosed", "(", ")", ")", "return", ";", "Socket", "socket", "=", "null", ";", "try", "{", "socket", "=", "conHandler", ".", ...
Sends an array of bytes through a data connection @param data The data to be sent @throws ResponseException When an error occurs
[ "Sends", "an", "array", "of", "bytes", "through", "a", "data", "connection" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L236-L259
103,522
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.sendData
public void sendData(InputStream in) throws ResponseException { if(con.isClosed()) return; Socket socket = null; try { socket = conHandler.createDataSocket(); dataConnections.add(socket); OutputStream out = socket.getOutputStream(); byte[] buffer...
java
public void sendData(InputStream in) throws ResponseException { if(con.isClosed()) return; Socket socket = null; try { socket = conHandler.createDataSocket(); dataConnections.add(socket); OutputStream out = socket.getOutputStream(); byte[] buffer...
[ "public", "void", "sendData", "(", "InputStream", "in", ")", "throws", "ResponseException", "{", "if", "(", "con", ".", "isClosed", "(", ")", ")", "return", ";", "Socket", "socket", "=", "null", ";", "try", "{", "socket", "=", "conHandler", ".", "createD...
Sends a stream through a data connection @param in The input stream @throws ResponseException When an error occurs
[ "Sends", "a", "stream", "through", "a", "data", "connection" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L266-L294
103,523
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.abortDataTransfers
public void abortDataTransfers() { while(!dataConnections.isEmpty()) { Socket socket = dataConnections.poll(); if(socket != null) Utils.closeQuietly(socket); } }
java
public void abortDataTransfers() { while(!dataConnections.isEmpty()) { Socket socket = dataConnections.poll(); if(socket != null) Utils.closeQuietly(socket); } }
[ "public", "void", "abortDataTransfers", "(", ")", "{", "while", "(", "!", "dataConnections", ".", "isEmpty", "(", ")", ")", "{", "Socket", "socket", "=", "dataConnections", ".", "poll", "(", ")", ";", "if", "(", "socket", "!=", "null", ")", "Utils", "....
Aborts all data transfers
[ "Aborts", "all", "data", "transfers" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L334-L339
103,524
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.registerOption
public void registerOption(String option, String value) { options.put(option.toUpperCase(), value); }
java
public void registerOption(String option, String value) { options.put(option.toUpperCase(), value); }
[ "public", "void", "registerOption", "(", "String", "option", ",", "String", "value", ")", "{", "options", ".", "put", "(", "option", ".", "toUpperCase", "(", ")", ",", "value", ")", ";", "}" ]
Registers an option for the OPTS command @param option The option name @param value The default value
[ "Registers", "an", "option", "for", "the", "OPTS", "command" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L356-L358
103,525
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.addSiteCommand
protected void addSiteCommand(String label, String help, Command cmd) { siteCommands.put(label.toUpperCase(), new CommandInfo(cmd, help, true)); }
java
protected void addSiteCommand(String label, String help, Command cmd) { siteCommands.put(label.toUpperCase(), new CommandInfo(cmd, help, true)); }
[ "protected", "void", "addSiteCommand", "(", "String", "label", ",", "String", "help", ",", "Command", "cmd", ")", "{", "siteCommands", ".", "put", "(", "label", ".", "toUpperCase", "(", ")", ",", "new", "CommandInfo", "(", "cmd", ",", "help", ",", "true"...
Internally registers a SITE sub-command @param label The command name @param help The help message @param cmd The command function
[ "Internally", "registers", "a", "SITE", "sub", "-", "command" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L411-L413
103,526
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.addCommand
protected void addCommand(String label, String help, Command cmd, boolean needsAuth) { commands.put(label.toUpperCase(), new CommandInfo(cmd, help, needsAuth)); }
java
protected void addCommand(String label, String help, Command cmd, boolean needsAuth) { commands.put(label.toUpperCase(), new CommandInfo(cmd, help, needsAuth)); }
[ "protected", "void", "addCommand", "(", "String", "label", ",", "String", "help", ",", "Command", "cmd", ",", "boolean", "needsAuth", ")", "{", "commands", ".", "put", "(", "label", ".", "toUpperCase", "(", ")", ",", "new", "CommandInfo", "(", "cmd", ","...
Internally registers a command @param label The command name @param help The help message @param cmd The command function @param needsAuth Whether authentication is required to run this command
[ "Internally", "registers", "a", "command" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L422-L424
103,527
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.getSiteHelpMessage
public String getSiteHelpMessage(String label) { CommandInfo info = siteCommands.get(label); return info != null ? info.help : null; }
java
public String getSiteHelpMessage(String label) { CommandInfo info = siteCommands.get(label); return info != null ? info.help : null; }
[ "public", "String", "getSiteHelpMessage", "(", "String", "label", ")", "{", "CommandInfo", "info", "=", "siteCommands", ".", "get", "(", "label", ")", ";", "return", "info", "!=", "null", "?", "info", ".", "help", ":", "null", ";", "}" ]
Gets the help message from a SITE command @param label The command name @return The help message or {@code null} if the command was not found
[ "Gets", "the", "help", "message", "from", "a", "SITE", "command" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L431-L434
103,528
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.getHelpMessage
public String getHelpMessage(String label) { CommandInfo info = commands.get(label); return info != null ? info.help : null; }
java
public String getHelpMessage(String label) { CommandInfo info = commands.get(label); return info != null ? info.help : null; }
[ "public", "String", "getHelpMessage", "(", "String", "label", ")", "{", "CommandInfo", "info", "=", "commands", ".", "get", "(", "label", ")", ";", "return", "info", "!=", "null", "?", "info", ".", "help", ":", "null", ";", "}" ]
Gets the help message from a command @param label The command name @return The help message or {@code null} if the command was not found
[ "Gets", "the", "help", "message", "from", "a", "command" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L441-L444
103,529
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.update
protected void update() { if(conHandler.shouldStop()) { Utils.closeQuietly(this); return; } String line; try { line = reader.readLine(); } catch(SocketTimeoutException ex) { // Check if the socket has timed out if(!dat...
java
protected void update() { if(conHandler.shouldStop()) { Utils.closeQuietly(this); return; } String line; try { line = reader.readLine(); } catch(SocketTimeoutException ex) { // Check if the socket has timed out if(!dat...
[ "protected", "void", "update", "(", ")", "{", "if", "(", "conHandler", ".", "shouldStop", "(", ")", ")", "{", "Utils", ".", "closeQuietly", "(", "this", ")", ";", "return", ";", "}", "String", "line", ";", "try", "{", "line", "=", "reader", ".", "r...
Updates the connection
[ "Updates", "the", "connection" ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L550-L578
103,530
Guichaguri/MinimalFTP
src/main/java/com/guichaguri/minimalftp/FTPConnection.java
FTPConnection.stop
protected void stop(boolean close) throws IOException { if(!thread.isInterrupted()) { thread.interrupt(); } conHandler.onDisconnected(); if(close) con.close(); }
java
protected void stop(boolean close) throws IOException { if(!thread.isInterrupted()) { thread.interrupt(); } conHandler.onDisconnected(); if(close) con.close(); }
[ "protected", "void", "stop", "(", "boolean", "close", ")", "throws", "IOException", "{", "if", "(", "!", "thread", ".", "isInterrupted", "(", ")", ")", "{", "thread", ".", "interrupt", "(", ")", ";", "}", "conHandler", ".", "onDisconnected", "(", ")", ...
Stops the connection, but does not removes it from the list. For a complete cleanup, use {@link #close()} instead @param close Whether it will close the connection @throws IOException When an I/O error occurs
[ "Stops", "the", "connection", "but", "does", "not", "removes", "it", "from", "the", "list", "." ]
ddd81e26ec88079ee4c37fe53d8efe420996e9b1
https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L587-L595
103,531
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/DependencyEmbedder.java
DependencyEmbedder.generate
public Properties generate(Properties instructions, ProjectDependencies dependencies) { Properties result = new Properties(); result.putAll(instructions); StringBuilder include = new StringBuilder(); if (instructions.getProperty(Constants.INCLUDE_RESOURCE) != null) { include....
java
public Properties generate(Properties instructions, ProjectDependencies dependencies) { Properties result = new Properties(); result.putAll(instructions); StringBuilder include = new StringBuilder(); if (instructions.getProperty(Constants.INCLUDE_RESOURCE) != null) { include....
[ "public", "Properties", "generate", "(", "Properties", "instructions", ",", "ProjectDependencies", "dependencies", ")", "{", "Properties", "result", "=", "new", "Properties", "(", ")", ";", "result", ".", "putAll", "(", "instructions", ")", ";", "StringBuilder", ...
Generates the new set of instruction containing the original set of instructions enhanced with the embed dependencies results. @param instructions the current set of instructions @param dependencies the project's dependencies @return the final set of instructions
[ "Generates", "the", "new", "set", "of", "instruction", "containing", "the", "original", "set", "of", "instructions", "enhanced", "with", "the", "embed", "dependencies", "results", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/DependencyEmbedder.java#L160-L191
103,532
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java
WatcherUtils.isInDirectory
public static boolean isInDirectory(File file, File directory) { try { return FilenameUtils.directoryContains(directory.getCanonicalPath(), file.getCanonicalPath()); } catch (IOException e) { //NOSONAR return false; } }
java
public static boolean isInDirectory(File file, File directory) { try { return FilenameUtils.directoryContains(directory.getCanonicalPath(), file.getCanonicalPath()); } catch (IOException e) { //NOSONAR return false; } }
[ "public", "static", "boolean", "isInDirectory", "(", "File", "file", ",", "File", "directory", ")", "{", "try", "{", "return", "FilenameUtils", ".", "directoryContains", "(", "directory", ".", "getCanonicalPath", "(", ")", ",", "file", ".", "getCanonicalPath", ...
Checks whether the given file is inside the given directory. @param file the file @param directory the directory @return {@literal true} if the file is in the directory (or any subdirectories), {@literal false} otherwise.
[ "Checks", "whether", "the", "given", "file", "is", "inside", "the", "given", "directory", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java#L44-L50
103,533
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java
WatcherUtils.hasExtension
public static boolean hasExtension(File file, String... extensions) { String extension = FilenameUtils.getExtension(file.getName()); for (String s : extensions) { if (extension.equalsIgnoreCase(s) || ("." + extension).equalsIgnoreCase(s)) { return true; } ...
java
public static boolean hasExtension(File file, String... extensions) { String extension = FilenameUtils.getExtension(file.getName()); for (String s : extensions) { if (extension.equalsIgnoreCase(s) || ("." + extension).equalsIgnoreCase(s)) { return true; } ...
[ "public", "static", "boolean", "hasExtension", "(", "File", "file", ",", "String", "...", "extensions", ")", "{", "String", "extension", "=", "FilenameUtils", ".", "getExtension", "(", "file", ".", "getName", "(", ")", ")", ";", "for", "(", "String", "s", ...
Checks whether the given file has one of the given extension. @param file the file @param extensions the extensions @return {@literal true} if the file has one of the given extension, {@literal false} otherwise
[ "Checks", "whether", "the", "given", "file", "has", "one", "of", "the", "given", "extension", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WatcherUtils.java#L159-L167
103,534
wisdom-framework/wisdom
documentation/documentation/src/main/java/controllers/Documentation.java
Documentation.routes
@Override public List<org.wisdom.api.router.Route> routes() { // If documentation.standalone is not set to false, register a route on / if (configuration.getBooleanWithDefault("documentation.standalone", true)) { return ImmutableList.of(new RouteBuilder().route(HttpMethod.GET).on("/").to...
java
@Override public List<org.wisdom.api.router.Route> routes() { // If documentation.standalone is not set to false, register a route on / if (configuration.getBooleanWithDefault("documentation.standalone", true)) { return ImmutableList.of(new RouteBuilder().route(HttpMethod.GET).on("/").to...
[ "@", "Override", "public", "List", "<", "org", ".", "wisdom", ".", "api", ".", "router", ".", "Route", ">", "routes", "(", ")", "{", "// If documentation.standalone is not set to false, register a route on /", "if", "(", "configuration", ".", "getBooleanWithDefault", ...
Default implementation of the routes method. @return an empty list. The router must also check for the {@link org.wisdom.api.annotations .Route} annotations.
[ "Default", "implementation", "of", "the", "routes", "method", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/documentation/documentation/src/main/java/controllers/Documentation.java#L57-L65
103,535
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java
ExtractUtil.extractResponseCodes
public static List<String> extractResponseCodes(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_CODE,jdoc)); return list; }
java
public static List<String> extractResponseCodes(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_CODE,jdoc)); return list; }
[ "public", "static", "List", "<", "String", ">", "extractResponseCodes", "(", "JavadocComment", "jdoc", ")", "{", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "list", ".", "addAll", "(", "extractDocAnnotation", "(", "DOC...
Return the response codes as String from a JavaDoc comment block. @param jdoc The javadoc block comment. @return the response codes as String
[ "Return", "the", "response", "codes", "as", "String", "from", "a", "JavaDoc", "comment", "block", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java#L183-L188
103,536
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java
ExtractUtil.extractResponseDescription
public static List<String> extractResponseDescription(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_DESCRIPTION,jdoc)); return list; }
java
public static List<String> extractResponseDescription(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_DESCRIPTION,jdoc)); return list; }
[ "public", "static", "List", "<", "String", ">", "extractResponseDescription", "(", "JavadocComment", "jdoc", ")", "{", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "list", ".", "addAll", "(", "extractDocAnnotation", "(", ...
Return the response descriptions as String from a JavaDoc comment block. @param jdoc The javadoc block comment. @return the response descriptions as String
[ "Return", "the", "response", "descriptions", "as", "String", "from", "a", "JavaDoc", "comment", "block", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java#L196-L201
103,537
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java
ExtractUtil.extractResponseBodies
public static List<String> extractResponseBodies(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_BODY,jdoc)); return list; }
java
public static List<String> extractResponseBodies(JavadocComment jdoc){ List<String> list = new ArrayList<>(); list.addAll(extractDocAnnotation(DOC_RESPONSE_BODY,jdoc)); return list; }
[ "public", "static", "List", "<", "String", ">", "extractResponseBodies", "(", "JavadocComment", "jdoc", ")", "{", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "list", ".", "addAll", "(", "extractDocAnnotation", "(", "DO...
Return the response bodies as String from a JavaDoc comment block. @param jdoc The javadoc block comment. @return the response bodies as String
[ "Return", "the", "response", "bodies", "as", "String", "from", "a", "JavaDoc", "comment", "block", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java#L209-L214
103,538
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java
ExtractUtil.extractDescription
public static String extractDescription(JavadocComment jdoc){ String content = jdoc.getContent().replaceAll("\n[ \t]+\\* ?","\n"); //remove the * at the beginning of a line int end = content.indexOf("\n@"); //look for the first annotation //The first charater is always a new line if(en...
java
public static String extractDescription(JavadocComment jdoc){ String content = jdoc.getContent().replaceAll("\n[ \t]+\\* ?","\n"); //remove the * at the beginning of a line int end = content.indexOf("\n@"); //look for the first annotation //The first charater is always a new line if(en...
[ "public", "static", "String", "extractDescription", "(", "JavadocComment", "jdoc", ")", "{", "String", "content", "=", "jdoc", ".", "getContent", "(", ")", ".", "replaceAll", "(", "\"\\n[ \\t]+\\\\* ?\"", ",", "\"\\n\"", ")", ";", "//remove the * at the beginning of...
Get a text description from JavaDoc block comment. @param jdoc the javadoc block comment. @return The description as String.
[ "Get", "a", "text", "description", "from", "JavaDoc", "block", "comment", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/util/ExtractUtil.java#L222-L233
103,539
wisdom-framework/wisdom
framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/HibernateValidatorModule.java
HibernateValidatorModule.version
public final Version version() { return new Version(bundle.getVersion().getMajor(), bundle.getVersion().getMinor(), bundle.getVersion().getMicro(), null, null, null); }
java
public final Version version() { return new Version(bundle.getVersion().getMajor(), bundle.getVersion().getMinor(), bundle.getVersion().getMicro(), null, null, null); }
[ "public", "final", "Version", "version", "(", ")", "{", "return", "new", "Version", "(", "bundle", ".", "getVersion", "(", ")", ".", "getMajor", "(", ")", ",", "bundle", ".", "getVersion", "(", ")", ".", "getMinor", "(", ")", ",", "bundle", ".", "get...
Retrieves the version from the bundle version. @return the version
[ "Retrieves", "the", "version", "from", "the", "bundle", "version", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/HibernateValidatorModule.java#L71-L74
103,540
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java
CookieHelper.convertWisdomCookieToNettyCookie
public static DefaultCookie convertWisdomCookieToNettyCookie(Cookie cookie) { DefaultCookie nettyCookie = new DefaultCookie(cookie.name(), cookie.value()); nettyCookie.setMaxAge(cookie.maxAge()); // Comments are not supported anymore by netty. if (cookie.domain() != null) { n...
java
public static DefaultCookie convertWisdomCookieToNettyCookie(Cookie cookie) { DefaultCookie nettyCookie = new DefaultCookie(cookie.name(), cookie.value()); nettyCookie.setMaxAge(cookie.maxAge()); // Comments are not supported anymore by netty. if (cookie.domain() != null) { n...
[ "public", "static", "DefaultCookie", "convertWisdomCookieToNettyCookie", "(", "Cookie", "cookie", ")", "{", "DefaultCookie", "nettyCookie", "=", "new", "DefaultCookie", "(", "cookie", ".", "name", "(", ")", ",", "cookie", ".", "value", "(", ")", ")", ";", "net...
Converts the Wisdom's cookie to a Netty's cookie. @param cookie the Wisdom's cookie @return the Netty's cookie with the same metadata and content than the input cookie.
[ "Converts", "the", "Wisdom", "s", "cookie", "to", "a", "Netty", "s", "cookie", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java#L44-L61
103,541
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java
CookieHelper.convertNettyCookieToWisdomCookie
public static Cookie convertNettyCookieToWisdomCookie(DefaultCookie cookie) { Preconditions.checkNotNull(cookie); String value = cookie.value(); // // Netty append some data at the end f the cookie: // // -createdBy=wisdom&at=3+nov.+2013+11%3A52%3A15&___TS=1383475935779, path=/, maxAge=360...
java
public static Cookie convertNettyCookieToWisdomCookie(DefaultCookie cookie) { Preconditions.checkNotNull(cookie); String value = cookie.value(); // // Netty append some data at the end f the cookie: // // -createdBy=wisdom&at=3+nov.+2013+11%3A52%3A15&___TS=1383475935779, path=/, maxAge=360...
[ "public", "static", "Cookie", "convertNettyCookieToWisdomCookie", "(", "DefaultCookie", "cookie", ")", "{", "Preconditions", ".", "checkNotNull", "(", "cookie", ")", ";", "String", "value", "=", "cookie", ".", "value", "(", ")", ";", "// // Netty append some ...
Converts the Netty's cookie to a Wisdom's cookie. @param cookie the Netty's cookie @return the Wisdom's cookie with the same metadata and content than the input cookie.
[ "Converts", "the", "Netty", "s", "cookie", "to", "a", "Wisdom", "s", "cookie", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java#L69-L98
103,542
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java
CookieHelper.getCookieValue
public static String getCookieValue(String name, Cookies cookies) { Cookie c = cookies.get(name); if (c != null) { return c.value(); } return null; }
java
public static String getCookieValue(String name, Cookies cookies) { Cookie c = cookies.get(name); if (c != null) { return c.value(); } return null; }
[ "public", "static", "String", "getCookieValue", "(", "String", "name", ",", "Cookies", "cookies", ")", "{", "Cookie", "c", "=", "cookies", ".", "get", "(", "name", ")", ";", "if", "(", "c", "!=", "null", ")", "{", "return", "c", ".", "value", "(", ...
Gets the value of the cookie having the given name. The cookie is looked from the given cookies set. @param name the name of the cookie @param cookies the set of cookie @return the value of the cookie, {@literal null} if there are no cookie with the given name in the cookies set.
[ "Gets", "the", "value", "of", "the", "cookie", "having", "the", "given", "name", ".", "The", "cookie", "is", "looked", "from", "the", "given", "cookies", "set", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/CookieHelper.java#L107-L113
103,543
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ApplicationSecretGenerator.java
ApplicationSecretGenerator.ensureOrGenerateSecret
public static void ensureOrGenerateSecret(MavenProject project, Log log) throws IOException { File conf = new File(project.getBasedir(), "src/main/configuration/application.conf"); if (conf.isFile()) { List<String> lines = FileUtils.readLines(conf); boolean changed = false; ...
java
public static void ensureOrGenerateSecret(MavenProject project, Log log) throws IOException { File conf = new File(project.getBasedir(), "src/main/configuration/application.conf"); if (conf.isFile()) { List<String> lines = FileUtils.readLines(conf); boolean changed = false; ...
[ "public", "static", "void", "ensureOrGenerateSecret", "(", "MavenProject", "project", ",", "Log", "log", ")", "throws", "IOException", "{", "File", "conf", "=", "new", "File", "(", "project", ".", "getBasedir", "(", ")", ",", "\"src/main/configuration/application....
Checks whether the application configuration file as the application secret. If not generates one. @param project the Maven Project @param log the logger @throws java.io.IOException if the application file cannot be read, or rewritten
[ "Checks", "whether", "the", "application", "configuration", "file", "as", "the", "application", "secret", ".", "If", "not", "generates", "one", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ApplicationSecretGenerator.java#L78-L110
103,544
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java
PluginExtractor.getBuildPluginVersion
public static String getBuildPluginVersion(AbstractWisdomMojo mojo, String plugin) { List<Plugin> plugins = mojo.project.getBuildPlugins(); for (Plugin plug : plugins) { if (plug.getArtifactId().equals(plugin)) { return plug.getVersion(); } } // No...
java
public static String getBuildPluginVersion(AbstractWisdomMojo mojo, String plugin) { List<Plugin> plugins = mojo.project.getBuildPlugins(); for (Plugin plug : plugins) { if (plug.getArtifactId().equals(plugin)) { return plug.getVersion(); } } // No...
[ "public", "static", "String", "getBuildPluginVersion", "(", "AbstractWisdomMojo", "mojo", ",", "String", "plugin", ")", "{", "List", "<", "Plugin", ">", "plugins", "=", "mojo", ".", "project", ".", "getBuildPlugins", "(", ")", ";", "for", "(", "Plugin", "plu...
Retrieves the plugin version from Maven Project. @param mojo the mojo @param plugin the artifact id of the plugin @return the version, {@code null} if the Maven Project does not used the given plugin
[ "Retrieves", "the", "plugin", "version", "from", "Maven", "Project", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java#L43-L52
103,545
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java
PluginExtractor.getBuildPluginConfiguration
public static Xpp3Dom getBuildPluginConfiguration(AbstractWisdomMojo mojo, String artifactId, String goal) { List<Plugin> plugins = mojo.project.getBuildPlugins(); Plugin plugin = null; for (Plugin plug : plugins) { if (plug.getArtifactId().equals(artifactId)) { plug...
java
public static Xpp3Dom getBuildPluginConfiguration(AbstractWisdomMojo mojo, String artifactId, String goal) { List<Plugin> plugins = mojo.project.getBuildPlugins(); Plugin plugin = null; for (Plugin plug : plugins) { if (plug.getArtifactId().equals(artifactId)) { plug...
[ "public", "static", "Xpp3Dom", "getBuildPluginConfiguration", "(", "AbstractWisdomMojo", "mojo", ",", "String", "artifactId", ",", "String", "goal", ")", "{", "List", "<", "Plugin", ">", "plugins", "=", "mojo", ".", "project", ".", "getBuildPlugins", "(", ")", ...
Retrieves the main configuration of the given plugin from the Maven Project. @param mojo the mojo @param artifactId the artifact id of the plugin @param goal an optional goal. If set if first check for a specific configuration executing this goal, if not found, it returns the global configuration @return t...
[ "Retrieves", "the", "main", "configuration", "of", "the", "given", "plugin", "from", "the", "Maven", "Project", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/PluginExtractor.java#L63-L93
103,546
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/InitializeMojo.java
InitializeMojo.clearPipelineError
private void clearPipelineError() { File dir = new File(buildDirectory, "pipeline"); if (dir.isDirectory()) { try { FileUtils.cleanDirectory(dir); } catch (IOException e) { getLog().warn("Cannot clean the pipeline directory", e); } ...
java
private void clearPipelineError() { File dir = new File(buildDirectory, "pipeline"); if (dir.isDirectory()) { try { FileUtils.cleanDirectory(dir); } catch (IOException e) { getLog().warn("Cannot clean the pipeline directory", e); } ...
[ "private", "void", "clearPipelineError", "(", ")", "{", "File", "dir", "=", "new", "File", "(", "buildDirectory", ",", "\"pipeline\"", ")", ";", "if", "(", "dir", ".", "isDirectory", "(", ")", ")", "{", "try", "{", "FileUtils", ".", "cleanDirectory", "("...
Deletes all error report from the pipeline error directory.
[ "Deletes", "all", "error", "report", "from", "the", "pipeline", "error", "directory", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/InitializeMojo.java#L190-L199
103,547
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Classpath.java
Classpath.store
public static void store(MavenProject project) throws IOException { final File output = new File(project.getBasedir(), Constants.DEPENDENCIES_FILE); output.getParentFile().mkdirs(); ProjectDependencies dependencies = new ProjectDependencies(project); mapper.writer() .with...
java
public static void store(MavenProject project) throws IOException { final File output = new File(project.getBasedir(), Constants.DEPENDENCIES_FILE); output.getParentFile().mkdirs(); ProjectDependencies dependencies = new ProjectDependencies(project); mapper.writer() .with...
[ "public", "static", "void", "store", "(", "MavenProject", "project", ")", "throws", "IOException", "{", "final", "File", "output", "=", "new", "File", "(", "project", ".", "getBasedir", "(", ")", ",", "Constants", ".", "DEPENDENCIES_FILE", ")", ";", "output"...
Stores the dependencies from the given project into the 'dependencies.json' file. @param project the project @throws IOException if the file cannot be created.
[ "Stores", "the", "dependencies", "from", "the", "given", "project", "into", "the", "dependencies", ".", "json", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Classpath.java#L73-L83
103,548
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Classpath.java
Classpath.load
public static ProjectDependencies load(File basedir) throws IOException { return mapper.reader(ProjectDependencies.class) .readValue(new File(basedir, Constants.DEPENDENCIES_FILE)); }
java
public static ProjectDependencies load(File basedir) throws IOException { return mapper.reader(ProjectDependencies.class) .readValue(new File(basedir, Constants.DEPENDENCIES_FILE)); }
[ "public", "static", "ProjectDependencies", "load", "(", "File", "basedir", ")", "throws", "IOException", "{", "return", "mapper", ".", "reader", "(", "ProjectDependencies", ".", "class", ")", ".", "readValue", "(", "new", "File", "(", "basedir", ",", "Constant...
Reloads the dependencies stored in the 'dependencies.json' file. @param basedir the base directory @return the list of artifacts. @throws IOException if the file cannot be read.
[ "Reloads", "the", "dependencies", "stored", "in", "the", "dependencies", ".", "json", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Classpath.java#L92-L95
103,549
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefensiveThreadFactory.java
DefensiveThreadFactory.newThread
@Override public Thread newThread(final Runnable runnable) { Runnable wrapped = new Runnable() { @Override public void run() { try { // As the runnable is wrapped in another runnable object, we call the run method directly. runn...
java
@Override public Thread newThread(final Runnable runnable) { Runnable wrapped = new Runnable() { @Override public void run() { try { // As the runnable is wrapped in another runnable object, we call the run method directly. runn...
[ "@", "Override", "public", "Thread", "newThread", "(", "final", "Runnable", "runnable", ")", "{", "Runnable", "wrapped", "=", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "// As the runnable is wrappe...
Creates a new threads. @param runnable the runnable, should not be {@literal null}. @return the created thread.
[ "Creates", "a", "new", "threads", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefensiveThreadFactory.java#L53-L70
103,550
wisdom-framework/wisdom
extensions/wisdom-asciidoc-maven-plugin/src/main/java/org/wisdom/asciidoc/AsciidocMojo.java
AsciidocMojo.execute
public void execute() throws MojoExecutionException { if (! watch) { removeFromWatching(); } if (extensions == null || extensions.isEmpty()) { extensions = ImmutableList.of("ad", "asciidoc", "adoc"); } if (instance == null) { ins...
java
public void execute() throws MojoExecutionException { if (! watch) { removeFromWatching(); } if (extensions == null || extensions.isEmpty()) { extensions = ImmutableList.of("ad", "asciidoc", "adoc"); } if (instance == null) { ins...
[ "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", "{", "if", "(", "!", "watch", ")", "{", "removeFromWatching", "(", ")", ";", "}", "if", "(", "extensions", "==", "null", "||", "extensions", ".", "isEmpty", "(", ")", ")", "{", ...
Compiles Asciidoc files from the internal and external assets to HTML. @throws MojoExecutionException if the processing failed
[ "Compiles", "Asciidoc", "files", "from", "the", "internal", "and", "external", "assets", "to", "HTML", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-asciidoc-maven-plugin/src/main/java/org/wisdom/asciidoc/AsciidocMojo.java#L113-L186
103,551
wisdom-framework/wisdom
framework/i18n-service/src/main/java/org/wisdom/i18n/I18nController.java
I18nController.getBundleResourceForI18Next
@Route(method = HttpMethod.GET, uri = "i18n/bundles/{file<.+>}.json") public Result getBundleResourceForI18Next(@QueryParameter("locales") String listOfLocales, @HttpParameter(HeaderNames.IF_NONE_MATCH) String ifNoneMatch) { // Parse the list of locale L...
java
@Route(method = HttpMethod.GET, uri = "i18n/bundles/{file<.+>}.json") public Result getBundleResourceForI18Next(@QueryParameter("locales") String listOfLocales, @HttpParameter(HeaderNames.IF_NONE_MATCH) String ifNoneMatch) { // Parse the list of locale L...
[ "@", "Route", "(", "method", "=", "HttpMethod", ".", "GET", ",", "uri", "=", "\"i18n/bundles/{file<.+>}.json\"", ")", "public", "Result", "getBundleResourceForI18Next", "(", "@", "QueryParameter", "(", "\"locales\"", ")", "String", "listOfLocales", ",", "@", "Http...
Gets the internationalized messages as a JSON document compliant with the I18Next format. @param listOfLocales the list of locales @param ifNoneMatch the received ETAG if any @return the JSON document containing the messages
[ "Gets", "the", "internationalized", "messages", "as", "a", "JSON", "document", "compliant", "with", "the", "I18Next", "format", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/I18nController.java#L98-L145
103,552
wisdom-framework/wisdom
framework/i18n-service/src/main/java/org/wisdom/i18n/I18nController.java
I18nController.getMessage
@Route(method = HttpMethod.GET, uri = "i18n/{key}") public Result getMessage(@Parameter("key") String key, @QueryParameter("locale") Locale locale) { String message; if (locale != null && !locale.equals(InternationalizationService.DEFAULT_LOCALE)) { message = service.get(locale, key); ...
java
@Route(method = HttpMethod.GET, uri = "i18n/{key}") public Result getMessage(@Parameter("key") String key, @QueryParameter("locale") Locale locale) { String message; if (locale != null && !locale.equals(InternationalizationService.DEFAULT_LOCALE)) { message = service.get(locale, key); ...
[ "@", "Route", "(", "method", "=", "HttpMethod", ".", "GET", ",", "uri", "=", "\"i18n/{key}\"", ")", "public", "Result", "getMessage", "(", "@", "Parameter", "(", "\"key\"", ")", "String", "key", ",", "@", "QueryParameter", "(", "\"locale\"", ")", "Locale",...
Gets a specific internationalized message. @param key the key @param locale the locale. If {@code null} if uses the first locale from the request. @return the message as text, or {@code NOT FOUND} if the key cannot be found.
[ "Gets", "a", "specific", "internationalized", "message", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/I18nController.java#L173-L187
103,553
wisdom-framework/wisdom
core/router/src/main/java/org/wisdom/router/DefaultWebSocketCallback.java
DefaultWebSocketCallback.check
public boolean check() { if (!method.getReturnType().equals(Void.TYPE)) { WebSocketRouter.getLogger().error("The method {} annotated with a web socket callback is not well-formed. " + "These methods receive only parameter annotated with @Parameter and do not return anythi...
java
public boolean check() { if (!method.getReturnType().equals(Void.TYPE)) { WebSocketRouter.getLogger().error("The method {} annotated with a web socket callback is not well-formed. " + "These methods receive only parameter annotated with @Parameter and do not return anythi...
[ "public", "boolean", "check", "(", ")", "{", "if", "(", "!", "method", ".", "getReturnType", "(", ")", ".", "equals", "(", "Void", ".", "TYPE", ")", ")", "{", "WebSocketRouter", ".", "getLogger", "(", ")", ".", "error", "(", "\"The method {} annotated wi...
Checks that the callback is well-formed. @return {@code true} if the callback is well-formed, {@code false} otherwise.
[ "Checks", "that", "the", "callback", "is", "well", "-", "formed", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/DefaultWebSocketCallback.java#L143-L159
103,554
wisdom-framework/wisdom
core/router/src/main/java/org/wisdom/router/DefaultWebSocketCallback.java
DefaultWebSocketCallback.invoke
public void invoke(String uri, String client, byte[] content) throws InvocationTargetException, IllegalAccessException { Map<String, String> values = getPathParametersEncoded(uri); Object[] parameters = new Object[arguments.size()]; for (int i = 0; i < arguments.size(); i...
java
public void invoke(String uri, String client, byte[] content) throws InvocationTargetException, IllegalAccessException { Map<String, String> values = getPathParametersEncoded(uri); Object[] parameters = new Object[arguments.size()]; for (int i = 0; i < arguments.size(); i...
[ "public", "void", "invoke", "(", "String", "uri", ",", "String", "client", ",", "byte", "[", "]", "content", ")", "throws", "InvocationTargetException", ",", "IllegalAccessException", "{", "Map", "<", "String", ",", "String", ">", "values", "=", "getPathParame...
Invokes the callback. @param uri the uri @param client the client identifier (the one having sent the message) @param content the payload of the message @throws InvocationTargetException when the callback throws an exception @throws IllegalAccessException when the callback cannot be called
[ "Invokes", "the", "callback", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/DefaultWebSocketCallback.java#L187-L207
103,555
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitOutputStream.java
WisitOutputStream.publish
private void publish(String buffer){ CommandResult out = new CommandResult(myType); out.setContent(buffer); synchronized (lock) { publisher.publish(topic, out.toString()); } }
java
private void publish(String buffer){ CommandResult out = new CommandResult(myType); out.setContent(buffer); synchronized (lock) { publisher.publish(topic, out.toString()); } }
[ "private", "void", "publish", "(", "String", "buffer", ")", "{", "CommandResult", "out", "=", "new", "CommandResult", "(", "myType", ")", ";", "out", ".", "setContent", "(", "buffer", ")", ";", "synchronized", "(", "lock", ")", "{", "publisher", ".", "pu...
Use the Publisher in order to broadcast the command result through the web-socket. @param buffer the buffer in which data is written
[ "Use", "the", "Publisher", "in", "order", "to", "broadcast", "the", "command", "result", "through", "the", "web", "-", "socket", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitOutputStream.java#L90-L98
103,556
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java
RamlCompilerMojo.controllerParsed
@Override public void controllerParsed(File source, ControllerModel<Raml> model) throws WatchingException { Raml raml = new Raml(); //Create a new raml file raml.setBaseUri(baseUri); //set the base uri raml.setVersion(project().getVersion()); //Visit the controller model to populate...
java
@Override public void controllerParsed(File source, ControllerModel<Raml> model) throws WatchingException { Raml raml = new Raml(); //Create a new raml file raml.setBaseUri(baseUri); //set the base uri raml.setVersion(project().getVersion()); //Visit the controller model to populate...
[ "@", "Override", "public", "void", "controllerParsed", "(", "File", "source", ",", "ControllerModel", "<", "Raml", ">", "model", ")", "throws", "WatchingException", "{", "Raml", "raml", "=", "new", "Raml", "(", ")", ";", "//Create a new raml file", "raml", "."...
Generate the raml file from a given controller source file. @param source The controller source file. @param model The controller model @throws WatchingException If there is a problem while creating the raml file.
[ "Generate", "the", "raml", "file", "from", "a", "given", "controller", "source", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java#L85-L106
103,557
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java
RamlCompilerMojo.getRamlOutputFile
private File getRamlOutputFile(File input) { String ramlFileName = input.getName().substring(0, input.getName().length() - 4) + "raml"; File outDir; if (outputDirectory == null) { outDir = new File(WatcherUtils.getExternalAssetsDestination(basedir), "raml"); } else { ...
java
private File getRamlOutputFile(File input) { String ramlFileName = input.getName().substring(0, input.getName().length() - 4) + "raml"; File outDir; if (outputDirectory == null) { outDir = new File(WatcherUtils.getExternalAssetsDestination(basedir), "raml"); } else { ...
[ "private", "File", "getRamlOutputFile", "(", "File", "input", ")", "{", "String", "ramlFileName", "=", "input", ".", "getName", "(", ")", ".", "substring", "(", "0", ",", "input", ".", "getName", "(", ")", ".", "length", "(", ")", "-", "4", ")", "+",...
Create the .raml file from the java source file. @param input The java source file. @return The File where the raml spec, for the given input, will be written.
[ "Create", "the", ".", "raml", "file", "from", "the", "java", "source", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java#L124-L135
103,558
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitSession.java
WisitSession.exec
public CommandResult exec(String commandLine) { CommandResult result = new CommandResult(RESULT); try { Object raw = shellSession.execute(commandLine); if(raw != null){ result.setContent(format(raw)); } } catch (Exception e) { //NOSONAR ...
java
public CommandResult exec(String commandLine) { CommandResult result = new CommandResult(RESULT); try { Object raw = shellSession.execute(commandLine); if(raw != null){ result.setContent(format(raw)); } } catch (Exception e) { //NOSONAR ...
[ "public", "CommandResult", "exec", "(", "String", "commandLine", ")", "{", "CommandResult", "result", "=", "new", "CommandResult", "(", "RESULT", ")", ";", "try", "{", "Object", "raw", "=", "shellSession", ".", "execute", "(", "commandLine", ")", ";", "if", ...
Execute a command on the gogo shell. @param commandLine The command to be executed. @return The CommandResult
[ "Execute", "a", "command", "on", "the", "gogo", "shell", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitSession.java#L71-L88
103,559
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitSession.java
WisitSession.format
private String format(Object o) { return shellSession.format(o, Converter.INSPECT).toString(); }
java
private String format(Object o) { return shellSession.format(o, Converter.INSPECT).toString(); }
[ "private", "String", "format", "(", "Object", "o", ")", "{", "return", "shellSession", ".", "format", "(", "o", ",", "Converter", ".", "INSPECT", ")", ".", "toString", "(", ")", ";", "}" ]
Format the given object as a String. @param o The raw object to be formatted @return The formatted string version of the raw object.
[ "Format", "the", "given", "object", "as", "a", "String", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/terminal/WisitSession.java#L95-L97
103,560
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/MixedFileUpload.java
MixedFileUpload.checkSize
private void checkSize(long newSize, long maxSize, HttpServerFileUpload upload) { if (maxSize >= 0 && newSize > maxSize) { upload.handler(null); report(new IllegalStateException("Size exceed allowed maximum capacity")); } }
java
private void checkSize(long newSize, long maxSize, HttpServerFileUpload upload) { if (maxSize >= 0 && newSize > maxSize) { upload.handler(null); report(new IllegalStateException("Size exceed allowed maximum capacity")); } }
[ "private", "void", "checkSize", "(", "long", "newSize", ",", "long", "maxSize", ",", "HttpServerFileUpload", "upload", ")", "{", "if", "(", "maxSize", ">=", "0", "&&", "newSize", ">", "maxSize", ")", "{", "upload", ".", "handler", "(", "null", ")", ";", ...
Checks whether we exceed the max allowed file size. @param newSize the expected size once the current chunk is consumed @param maxSize the max allowed size. @param upload the upload
[ "Checks", "whether", "we", "exceed", "the", "max", "allowed", "file", "size", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/MixedFileUpload.java#L98-L103
103,561
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.updatedTemplate
public void updatedTemplate(Bundle bundle, File templateFile) { ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile); if (template != null) { LOGGER.debug("Thymeleaf template updated for {} ({})", templateFile.getAbsoluteFile(), template.fullName()); updated...
java
public void updatedTemplate(Bundle bundle, File templateFile) { ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile); if (template != null) { LOGGER.debug("Thymeleaf template updated for {} ({})", templateFile.getAbsoluteFile(), template.fullName()); updated...
[ "public", "void", "updatedTemplate", "(", "Bundle", "bundle", ",", "File", "templateFile", ")", "{", "ThymeLeafTemplateImplementation", "template", "=", "getTemplateByFile", "(", "templateFile", ")", ";", "if", "(", "template", "!=", "null", ")", "{", "LOGGER", ...
Updates the template object using the given file as backend. @param bundle the bundle containing the template, use system bundle for external templates. @param templateFile the template file
[ "Updates", "the", "template", "object", "using", "the", "given", "file", "as", "backend", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L125-L137
103,562
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.getTemplateByFile
private ThymeLeafTemplateImplementation getTemplateByFile(File templateFile) { try { return getTemplateByURL(templateFile.toURI().toURL()); } catch (MalformedURLException e) { //NOSONAR // Ignored. } return null; }
java
private ThymeLeafTemplateImplementation getTemplateByFile(File templateFile) { try { return getTemplateByURL(templateFile.toURI().toURL()); } catch (MalformedURLException e) { //NOSONAR // Ignored. } return null; }
[ "private", "ThymeLeafTemplateImplementation", "getTemplateByFile", "(", "File", "templateFile", ")", "{", "try", "{", "return", "getTemplateByURL", "(", "templateFile", ".", "toURI", "(", ")", ".", "toURL", "(", ")", ")", ";", "}", "catch", "(", "MalformedURLExc...
Gets the template object using the given file as backend. @param templateFile the file @return the template object, {@literal null} if not found
[ "Gets", "the", "template", "object", "using", "the", "given", "file", "as", "backend", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L145-L152
103,563
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.getTemplateByURL
private ThymeLeafTemplateImplementation getTemplateByURL(URL url) { Collection<ThymeLeafTemplateImplementation> list = registrations.keySet(); for (ThymeLeafTemplateImplementation template : list) { if (template.getURL().sameFile(url)) { return template; } ...
java
private ThymeLeafTemplateImplementation getTemplateByURL(URL url) { Collection<ThymeLeafTemplateImplementation> list = registrations.keySet(); for (ThymeLeafTemplateImplementation template : list) { if (template.getURL().sameFile(url)) { return template; } ...
[ "private", "ThymeLeafTemplateImplementation", "getTemplateByURL", "(", "URL", "url", ")", "{", "Collection", "<", "ThymeLeafTemplateImplementation", ">", "list", "=", "registrations", ".", "keySet", "(", ")", ";", "for", "(", "ThymeLeafTemplateImplementation", "template...
Gets the template object using the given url as backend. @param url the url @return the template object, {@literal null} if not found
[ "Gets", "the", "template", "object", "using", "the", "given", "url", "as", "backend", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L160-L168
103,564
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.deleteTemplate
public void deleteTemplate(File templateFile) { ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile); if (template != null) { deleteTemplate(template); } }
java
public void deleteTemplate(File templateFile) { ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile); if (template != null) { deleteTemplate(template); } }
[ "public", "void", "deleteTemplate", "(", "File", "templateFile", ")", "{", "ThymeLeafTemplateImplementation", "template", "=", "getTemplateByFile", "(", "templateFile", ")", ";", "if", "(", "template", "!=", "null", ")", "{", "deleteTemplate", "(", "template", ")"...
Deletes the template using the given file as backend. @param templateFile the file
[ "Deletes", "the", "template", "using", "the", "given", "file", "as", "backend", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L175-L180
103,565
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.addTemplate
public ThymeLeafTemplateImplementation addTemplate(Bundle bundle, URL templateURL) { ThymeLeafTemplateImplementation template = getTemplateByURL(templateURL); if (template != null) { // Already existing. return template; } synchronized (this) { // need...
java
public ThymeLeafTemplateImplementation addTemplate(Bundle bundle, URL templateURL) { ThymeLeafTemplateImplementation template = getTemplateByURL(templateURL); if (template != null) { // Already existing. return template; } synchronized (this) { // need...
[ "public", "ThymeLeafTemplateImplementation", "addTemplate", "(", "Bundle", "bundle", ",", "URL", "templateURL", ")", "{", "ThymeLeafTemplateImplementation", "template", "=", "getTemplateByURL", "(", "templateURL", ")", ";", "if", "(", "template", "!=", "null", ")", ...
Adds a template form the given url. @param bundle the bundle containing the template, use system bundle for external templates. @param templateURL the url @return the added template. IF the given url is already used by another template, return this other template.
[ "Adds", "a", "template", "form", "the", "given", "url", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L189-L205
103,566
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.configure
@Validate public synchronized void configure() { // Thymeleaf specifics String mode = configuration.getWithDefault("application.template.thymeleaf.mode", "HTML5"); int ttl = configuration.getIntegerWithDefault("application.template.thymeleaf.ttl", 60 * 1000); if (configuration.isDev...
java
@Validate public synchronized void configure() { // Thymeleaf specifics String mode = configuration.getWithDefault("application.template.thymeleaf.mode", "HTML5"); int ttl = configuration.getIntegerWithDefault("application.template.thymeleaf.ttl", 60 * 1000); if (configuration.isDev...
[ "@", "Validate", "public", "synchronized", "void", "configure", "(", ")", "{", "// Thymeleaf specifics", "String", "mode", "=", "configuration", ".", "getWithDefault", "(", "\"application.template.thymeleaf.mode\"", ",", "\"HTML5\"", ")", ";", "int", "ttl", "=", "co...
Initializes the thymeleaf template engine.
[ "Initializes", "the", "thymeleaf", "template", "engine", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L210-L247
103,567
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.bindDialect
@Bind(optional = true, aggregate = true) public synchronized void bindDialect(IDialect dialect) { LOGGER.debug("Binding a new dialect using the prefix '{}' and containing {}", dialect.getPrefix(), dialect.getProcessors()); if (this.dialects.add(dialect)) { ...
java
@Bind(optional = true, aggregate = true) public synchronized void bindDialect(IDialect dialect) { LOGGER.debug("Binding a new dialect using the prefix '{}' and containing {}", dialect.getPrefix(), dialect.getProcessors()); if (this.dialects.add(dialect)) { ...
[ "@", "Bind", "(", "optional", "=", "true", ",", "aggregate", "=", "true", ")", "public", "synchronized", "void", "bindDialect", "(", "IDialect", "dialect", ")", "{", "LOGGER", ".", "debug", "(", "\"Binding a new dialect using the prefix '{}' and containing {}\"", ",...
A new dialect is now available. @param dialect the dialect
[ "A", "new", "dialect", "is", "now", "available", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L253-L266
103,568
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.unbindDialect
@Unbind public synchronized void unbindDialect(IDialect dialect) { LOGGER.debug("Binding a new dialect {}, processors: {}", dialect.getPrefix(), dialect.getProcessors()); if (this.dialects.remove(dialect)) { configure(); for (Template template : getTemplates()...
java
@Unbind public synchronized void unbindDialect(IDialect dialect) { LOGGER.debug("Binding a new dialect {}, processors: {}", dialect.getPrefix(), dialect.getProcessors()); if (this.dialects.remove(dialect)) { configure(); for (Template template : getTemplates()...
[ "@", "Unbind", "public", "synchronized", "void", "unbindDialect", "(", "IDialect", "dialect", ")", "{", "LOGGER", ".", "debug", "(", "\"Binding a new dialect {}, processors: {}\"", ",", "dialect", ".", "getPrefix", "(", ")", ",", "dialect", ".", "getProcessors", "...
A dialect has left. @param dialect the dialect that has left
[ "A", "dialect", "has", "left", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L272-L282
103,569
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.getTemplateByResourceName
public ThymeLeafTemplateImplementation getTemplateByResourceName(String resourceName) { Collection<ThymeLeafTemplateImplementation> list = registrations.keySet(); for (ThymeLeafTemplateImplementation template : list) { if (template.fullName().endsWith(resourceName) || tem...
java
public ThymeLeafTemplateImplementation getTemplateByResourceName(String resourceName) { Collection<ThymeLeafTemplateImplementation> list = registrations.keySet(); for (ThymeLeafTemplateImplementation template : list) { if (template.fullName().endsWith(resourceName) || tem...
[ "public", "ThymeLeafTemplateImplementation", "getTemplateByResourceName", "(", "String", "resourceName", ")", "{", "Collection", "<", "ThymeLeafTemplateImplementation", ">", "list", "=", "registrations", ".", "keySet", "(", ")", ";", "for", "(", "ThymeLeafTemplateImplemen...
Finds a template object from the given resource name. The first template matching the given name is returned. @param resourceName the name @return the template object.
[ "Finds", "a", "template", "object", "from", "the", "given", "resource", "name", ".", "The", "first", "template", "matching", "the", "given", "name", "is", "returned", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L316-L328
103,570
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java
ThymeleafTemplateCollector.deleteTemplate
public void deleteTemplate(ThymeLeafTemplateImplementation template) { // 1 - unregister the service try { ServiceRegistration reg = registrations.remove(template); if (reg != null) { reg.unregister(); } } catch (Exception e) { //NOSONAR ...
java
public void deleteTemplate(ThymeLeafTemplateImplementation template) { // 1 - unregister the service try { ServiceRegistration reg = registrations.remove(template); if (reg != null) { reg.unregister(); } } catch (Exception e) { //NOSONAR ...
[ "public", "void", "deleteTemplate", "(", "ThymeLeafTemplateImplementation", "template", ")", "{", "// 1 - unregister the service", "try", "{", "ServiceRegistration", "reg", "=", "registrations", ".", "remove", "(", "template", ")", ";", "if", "(", "reg", "!=", "null...
Deletes the given template. The service is unregistered, and the cache is cleared. @param template the template
[ "Deletes", "the", "given", "template", ".", "The", "service", "is", "unregistered", "and", "the", "cache", "is", "cleared", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/ThymeleafTemplateCollector.java#L343-L363
103,571
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java
BundlePackager.bundle
public static void bundle(File basedir, File output, Reporter reporter) throws IOException { ProjectScanner scanner = new ProjectScanner(basedir); // Loads the properties inherited from Maven. Properties instructions = readMavenProperties(basedir); // Loads the properties from the BND f...
java
public static void bundle(File basedir, File output, Reporter reporter) throws IOException { ProjectScanner scanner = new ProjectScanner(basedir); // Loads the properties inherited from Maven. Properties instructions = readMavenProperties(basedir); // Loads the properties from the BND f...
[ "public", "static", "void", "bundle", "(", "File", "basedir", ",", "File", "output", ",", "Reporter", "reporter", ")", "throws", "IOException", "{", "ProjectScanner", "scanner", "=", "new", "ProjectScanner", "(", "basedir", ")", ";", "// Loads the properties inher...
Creates the bundle. @param basedir the project's base directory @param output the output file @throws IOException occurs when the bundle cannot be built correctly.
[ "Creates", "the", "bundle", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L55-L139
103,572
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java
BundlePackager.mergeExtraHeaders
private static Properties mergeExtraHeaders(File baseDir, Properties properties) throws IOException { File extra = new File(baseDir, EXTRA_HEADERS_FILE); return Instructions.merge(properties, extra); }
java
private static Properties mergeExtraHeaders(File baseDir, Properties properties) throws IOException { File extra = new File(baseDir, EXTRA_HEADERS_FILE); return Instructions.merge(properties, extra); }
[ "private", "static", "Properties", "mergeExtraHeaders", "(", "File", "baseDir", ",", "Properties", "properties", ")", "throws", "IOException", "{", "File", "extra", "=", "new", "File", "(", "baseDir", ",", "EXTRA_HEADERS_FILE", ")", ";", "return", "Instructions", ...
If a bundle has added extra headers, they are added to the bundle manifest. @param baseDir the project directory @param properties the current set of properties in which the read metadata are written @return the merged set of properties
[ "If", "a", "bundle", "has", "added", "extra", "headers", "they", "are", "added", "to", "the", "bundle", "manifest", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L148-L151
103,573
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java
BundlePackager.addExtraHeaderToBundleManifest
public static void addExtraHeaderToBundleManifest(File baseDir, String header, String value) throws IOException { Properties props = new Properties(); File extra = new File(baseDir, EXTRA_HEADERS_FILE); extra.getParentFile().mkdirs(); // If the file exist it loads it, if not nothing happ...
java
public static void addExtraHeaderToBundleManifest(File baseDir, String header, String value) throws IOException { Properties props = new Properties(); File extra = new File(baseDir, EXTRA_HEADERS_FILE); extra.getParentFile().mkdirs(); // If the file exist it loads it, if not nothing happ...
[ "public", "static", "void", "addExtraHeaderToBundleManifest", "(", "File", "baseDir", ",", "String", "header", ",", "String", "value", ")", "throws", "IOException", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "File", "extra", "=", "new...
This method is used by plugin willing to add custom header to the bundle manifest. @param baseDir the project directory @param header the header to add @param value the value to write @throws IOException if the header cannot be added
[ "This", "method", "is", "used", "by", "plugin", "willing", "to", "add", "custom", "header", "to", "the", "bundle", "manifest", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L161-L179
103,574
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java
BundlePackager.getLocalResources
public static String getLocalResources(File basedir, boolean test, ProjectScanner scanner) { final String basePath = basedir.getAbsolutePath(); String target = "target/classes"; if (test) { target = "target/test-classes"; } Set<String> files = scanner.getLocalResource...
java
public static String getLocalResources(File basedir, boolean test, ProjectScanner scanner) { final String basePath = basedir.getAbsolutePath(); String target = "target/classes"; if (test) { target = "target/test-classes"; } Set<String> files = scanner.getLocalResource...
[ "public", "static", "String", "getLocalResources", "(", "File", "basedir", ",", "boolean", "test", ",", "ProjectScanner", "scanner", ")", "{", "final", "String", "basePath", "=", "basedir", ".", "getAbsolutePath", "(", ")", ";", "String", "target", "=", "\"tar...
Gets local resources. @param basedir the project's base directory @param test whether or not we compute the test resources @param scanner the project scanner to retrieve information about the sources and resources contained in the project @return the resource clause
[ "Gets", "local", "resources", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L244-L278
103,575
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/tracker/TemplateDeployer.java
TemplateDeployer.onFileCreate
@Override public void onFileCreate(File file) { try { engine.addTemplate(context.getBundle(0), file.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Cannot compute the url of file {}", file.getAbsolutePath(), e); } }
java
@Override public void onFileCreate(File file) { try { engine.addTemplate(context.getBundle(0), file.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Cannot compute the url of file {}", file.getAbsolutePath(), e); } }
[ "@", "Override", "public", "void", "onFileCreate", "(", "File", "file", ")", "{", "try", "{", "engine", ".", "addTemplate", "(", "context", ".", "getBundle", "(", "0", ")", ",", "file", ".", "toURI", "(", ")", ".", "toURL", "(", ")", ")", ";", "}",...
Callback called when an accepted file is created. @param file the new file
[ "Callback", "called", "when", "an", "accepted", "file", "is", "created", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/tracker/TemplateDeployer.java#L105-L112
103,576
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.headers
@Override public List<String> headers(String name) { return request.headers().get(name); }
java
@Override public List<String> headers(String name) { return request.headers().get(name); }
[ "@", "Override", "public", "List", "<", "String", ">", "headers", "(", "String", "name", ")", "{", "return", "request", ".", "headers", "(", ")", ".", "get", "(", "name", ")", ";", "}" ]
Get all the request headers with the given name. @return the header values
[ "Get", "all", "the", "request", "headers", "with", "the", "given", "name", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L425-L428
103,577
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.cookieValue
@Override public String cookieValue(String name) { return CookieHelper.getCookieValue(name, request().cookies()); }
java
@Override public String cookieValue(String name) { return CookieHelper.getCookieValue(name, request().cookies()); }
[ "@", "Override", "public", "String", "cookieValue", "(", "String", "name", ")", "{", "return", "CookieHelper", ".", "getCookieValue", "(", "name", ",", "request", "(", ")", ".", "cookies", "(", ")", ")", ";", "}" ]
Get the cookie value from the request, if defined. @param name The name of the cookie @return The cookie value, or null if the cookie was not found
[ "Get", "the", "cookie", "value", "from", "the", "request", "if", "defined", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L446-L449
103,578
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.reader
@Override public BufferedReader reader() throws IOException { byte[] raw = request.getRawBody(); if (raw != null) { return IOUtils.toBufferedReader(new InputStreamReader(new ByteArrayInputStream(raw))); } return null; }
java
@Override public BufferedReader reader() throws IOException { byte[] raw = request.getRawBody(); if (raw != null) { return IOUtils.toBufferedReader(new InputStreamReader(new ByteArrayInputStream(raw))); } return null; }
[ "@", "Override", "public", "BufferedReader", "reader", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "raw", "=", "request", ".", "getRawBody", "(", ")", ";", "if", "(", "raw", "!=", "null", ")", "{", "return", "IOUtils", ".", "toBufferedReade...
Gets the reader to read the request. @return The reader
[ "Gets", "the", "reader", "to", "read", "the", "request", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L520-L527
103,579
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.route
public void route(Route route) { // Can be called only once, with a non null route. Preconditions.checkState(this.route == null); Preconditions.checkNotNull(route); this.route = route; }
java
public void route(Route route) { // Can be called only once, with a non null route. Preconditions.checkState(this.route == null); Preconditions.checkNotNull(route); this.route = route; }
[ "public", "void", "route", "(", "Route", "route", ")", "{", "// Can be called only once, with a non null route.", "Preconditions", ".", "checkState", "(", "this", ".", "route", "==", "null", ")", ";", "Preconditions", ".", "checkNotNull", "(", "route", ")", ";", ...
Sets the route associated with the current context. @param route the route
[ "Sets", "the", "route", "associated", "with", "the", "current", "context", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L544-L549
103,580
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.file
@Override public FileItem file(String name) { for (FileItem item : request.getFiles()) { // FileItem that do not have an real file attached, should not be returned if (item.field().equals(name) && !Strings.isNullOrEmpty(item.name())) { return item; } ...
java
@Override public FileItem file(String name) { for (FileItem item : request.getFiles()) { // FileItem that do not have an real file attached, should not be returned if (item.field().equals(name) && !Strings.isNullOrEmpty(item.name())) { return item; } ...
[ "@", "Override", "public", "FileItem", "file", "(", "String", "name", ")", "{", "for", "(", "FileItem", "item", ":", "request", ".", "getFiles", "(", ")", ")", "{", "// FileItem that do not have an real file attached, should not be returned", "if", "(", "item", "....
Gets the uploaded file having a form's field matching the given name. @param name the name of the field of the form that have uploaded the file @return the file object, {@literal null} if there are no file with this name
[ "Gets", "the", "uploaded", "file", "having", "a", "form", "s", "field", "matching", "the", "given", "name", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L580-L589
103,581
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/bodies/RenderableString.java
RenderableString.render
@Override public InputStream render(Context context, Result result) throws RenderableException { byte[] bytes; // We have a result, charset have to be provided if (result != null) { if (result.getCharset() == null) { // No charset provided, use default encoding (...
java
@Override public InputStream render(Context context, Result result) throws RenderableException { byte[] bytes; // We have a result, charset have to be provided if (result != null) { if (result.getCharset() == null) { // No charset provided, use default encoding (...
[ "@", "Override", "public", "InputStream", "render", "(", "Context", "context", ",", "Result", "result", ")", "throws", "RenderableException", "{", "byte", "[", "]", "bytes", ";", "// We have a result, charset have to be provided", "if", "(", "result", "!=", "null", ...
Retrieves the content. @param context the HTTP context @param result the result having built this renderable object @return an input stream on the contained String. @throws RenderableException should not happen
[ "Retrieves", "the", "content", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/bodies/RenderableString.java#L127-L144
103,582
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.extractTokenFromRequest
@Override public String extractTokenFromRequest(Context context) { // First check the tags, this is where tokens are added if it's added to the current request // In that case, the request scope contains the token String token = (String) context.request().data().get(TOKEN_KEY); if (t...
java
@Override public String extractTokenFromRequest(Context context) { // First check the tags, this is where tokens are added if it's added to the current request // In that case, the request scope contains the token String token = (String) context.request().data().get(TOKEN_KEY); if (t...
[ "@", "Override", "public", "String", "extractTokenFromRequest", "(", "Context", "context", ")", "{", "// First check the tags, this is where tokens are added if it's added to the current request", "// In that case, the request scope contains the token", "String", "token", "=", "(", "...
Extracts the token from the request. This implementation checks in the request data, then in the CORS cookie if any, and finally in the session cookie. If the token is signed, it resigns it to avoid the BREACH vulnerability. @param context the context @return the extract token, {@code null} if no token.
[ "Extracts", "the", "token", "from", "the", "request", ".", "This", "implementation", "checks", "in", "the", "request", "data", "then", "in", "the", "CORS", "cookie", "if", "any", "and", "finally", "in", "the", "session", "cookie", ".", "If", "the", "token"...
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L87-L111
103,583
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.addTokenToResult
@Override public Result addTokenToResult(Context context, String newToken, Result result) { if (isCached(context)) { LOGGER.debug("Not adding token to a cached result"); return result; } LOGGER.debug("Adding token to result"); if (getCookieName() != null) { ...
java
@Override public Result addTokenToResult(Context context, String newToken, Result result) { if (isCached(context)) { LOGGER.debug("Not adding token to a cached result"); return result; } LOGGER.debug("Adding token to result"); if (getCookieName() != null) { ...
[ "@", "Override", "public", "Result", "addTokenToResult", "(", "Context", "context", ",", "String", "newToken", ",", "Result", "result", ")", "{", "if", "(", "isCached", "(", "context", ")", ")", "{", "LOGGER", ".", "debug", "(", "\"Not adding token to a cached...
Methods adding the CORS token to the given result. The effect depends on the configuration. @param context the context @param newToken the new token @param result the result that is enhanced @return the updated result
[ "Methods", "adding", "the", "CORS", "token", "to", "the", "given", "result", ".", "The", "effect", "depends", "on", "the", "configuration", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L164-L190
103,584
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.compareTokens
@Override public boolean compareTokens(String a, String b) { if (isSignedToken()) { return crypto.compareSignedTokens(a, b); } else { return crypto.constantTimeEquals(a, b); } }
java
@Override public boolean compareTokens(String a, String b) { if (isSignedToken()) { return crypto.compareSignedTokens(a, b); } else { return crypto.constantTimeEquals(a, b); } }
[ "@", "Override", "public", "boolean", "compareTokens", "(", "String", "a", ",", "String", "b", ")", "{", "if", "(", "isSignedToken", "(", ")", ")", "{", "return", "crypto", ".", "compareSignedTokens", "(", "a", ",", "b", ")", ";", "}", "else", "{", "...
Compares to token. @param a the first token @param b the second token @return {@code true} if the token are equal, {@code false} otherwise
[ "Compares", "to", "token", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L218-L225
103,585
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.extractTokenFromContent
@Override public String extractTokenFromContent(Context context) { // check query String String token = context.request().parameter(getTokenName()); if (token == null) { // Check a specified header token = context.header(CSRF_TOKEN_HEADER); } // If s...
java
@Override public String extractTokenFromContent(Context context) { // check query String String token = context.request().parameter(getTokenName()); if (token == null) { // Check a specified header token = context.header(CSRF_TOKEN_HEADER); } // If s...
[ "@", "Override", "public", "String", "extractTokenFromContent", "(", "Context", "context", ")", "{", "// check query String", "String", "token", "=", "context", ".", "request", "(", ")", ".", "parameter", "(", "getTokenName", "(", ")", ")", ";", "if", "(", "...
Extracts the token from the content of the request. This implementation checks inside the headers, and inside form body. @param context the context @return the extracted token, {@code null} if not found.
[ "Extracts", "the", "token", "from", "the", "content", "of", "the", "request", ".", "This", "implementation", "checks", "inside", "the", "headers", "and", "inside", "form", "body", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L234-L255
103,586
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.clearTokenIfInvalid
@Override public Result clearTokenIfInvalid(Context context, String msg) { Result error = handler.onError(context, msg); final String cookieName = getCookieName(); if (cookieName != null) { Cookie cookie = context.cookie(cookieName); if (cookie != null) { ...
java
@Override public Result clearTokenIfInvalid(Context context, String msg) { Result error = handler.onError(context, msg); final String cookieName = getCookieName(); if (cookieName != null) { Cookie cookie = context.cookie(cookieName); if (cookie != null) { ...
[ "@", "Override", "public", "Result", "clearTokenIfInvalid", "(", "Context", "context", ",", "String", "msg", ")", "{", "Result", "error", "=", "handler", ".", "onError", "(", "context", ",", "msg", ")", ";", "final", "String", "cookieName", "=", "getCookieNa...
Clears the token from the request @param context the context @param msg the error message @return the result
[ "Clears", "the", "token", "from", "the", "request" ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L264-L277
103,587
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleStates.java
BundleStates.from
public static String from(int state) { switch (state) { case Bundle.ACTIVE: return ACTIVE; case Bundle.INSTALLED: return INSTALLED; case Bundle.RESOLVED: return RESOLVED; case Bundle.STARTING: return ...
java
public static String from(int state) { switch (state) { case Bundle.ACTIVE: return ACTIVE; case Bundle.INSTALLED: return INSTALLED; case Bundle.RESOLVED: return RESOLVED; case Bundle.STARTING: return ...
[ "public", "static", "String", "from", "(", "int", "state", ")", "{", "switch", "(", "state", ")", "{", "case", "Bundle", ".", "ACTIVE", ":", "return", "ACTIVE", ";", "case", "Bundle", ".", "INSTALLED", ":", "return", "INSTALLED", ";", "case", "Bundle", ...
Gets the String form of the given OSGi bundle state. @param state the state @return the string form.
[ "Gets", "the", "String", "form", "of", "the", "given", "OSGi", "bundle", "state", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleStates.java#L46-L63
103,588
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleStates.java
BundleStates.from
public static int from(String state) { switch (state.toUpperCase()) { case ACTIVE: return Bundle.ACTIVE; case INSTALLED: return Bundle.INSTALLED; case RESOLVED: return Bundle.RESOLVED; case STARTING: ...
java
public static int from(String state) { switch (state.toUpperCase()) { case ACTIVE: return Bundle.ACTIVE; case INSTALLED: return Bundle.INSTALLED; case RESOLVED: return Bundle.RESOLVED; case STARTING: ...
[ "public", "static", "int", "from", "(", "String", "state", ")", "{", "switch", "(", "state", ".", "toUpperCase", "(", ")", ")", "{", "case", "ACTIVE", ":", "return", "Bundle", ".", "ACTIVE", ";", "case", "INSTALLED", ":", "return", "Bundle", ".", "INST...
Gets the OSGi state from the string form. @param state the state as String @return the OSGi bundle state
[ "Gets", "the", "OSGi", "state", "from", "the", "string", "form", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleStates.java#L81-L98
103,589
wisdom-framework/wisdom
framework/thymeleaf-template-engine/src/main/java/ognl/OgnlOps.java
OgnlOps.getNumericType
public static int getNumericType(int t1, int t2, boolean canBeNonNumeric) { int localt1 = t1; int localt2 = t2; if (localt1 == localt2) return localt1; if (canBeNonNumeric && (localt1 == NONNUMERIC || localt2 == NONNUMERIC || localt1 == CHAR || localt2 == CHAR)) ...
java
public static int getNumericType(int t1, int t2, boolean canBeNonNumeric) { int localt1 = t1; int localt2 = t2; if (localt1 == localt2) return localt1; if (canBeNonNumeric && (localt1 == NONNUMERIC || localt2 == NONNUMERIC || localt1 == CHAR || localt2 == CHAR)) ...
[ "public", "static", "int", "getNumericType", "(", "int", "t1", ",", "int", "t2", ",", "boolean", "canBeNonNumeric", ")", "{", "int", "localt1", "=", "t1", ";", "int", "localt2", "=", "t2", ";", "if", "(", "localt1", "==", "localt2", ")", "return", "loc...
Returns the constant from the NumericTypes interface that best expresses the type of an operation, which can be either numeric or not, on the two given types. @param localt1 type of one argument to an operator @param localt2 type of the other argument @param canBeNonNumeric whether the operator can be ...
[ "Returns", "the", "constant", "from", "the", "NumericTypes", "interface", "that", "best", "expresses", "the", "type", "of", "an", "operation", "which", "can", "be", "either", "numeric", "or", "not", "on", "the", "two", "given", "types", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/ognl/OgnlOps.java#L428-L461
103,590
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Socket.java
Socket.publish
public void publish(byte[] message, EventBus bus) { bus.publish(getBinaryWriteHandlerId(), Buffer.buffer(message)); }
java
public void publish(byte[] message, EventBus bus) { bus.publish(getBinaryWriteHandlerId(), Buffer.buffer(message)); }
[ "public", "void", "publish", "(", "byte", "[", "]", "message", ",", "EventBus", "bus", ")", "{", "bus", ".", "publish", "(", "getBinaryWriteHandlerId", "(", ")", ",", "Buffer", ".", "buffer", "(", "message", ")", ")", ";", "}" ]
Sends a binary frame on the socket. @param message the message @param bus the Vert.x event bus.
[ "Sends", "a", "binary", "frame", "on", "the", "socket", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Socket.java#L95-L97
103,591
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/ServiceModel.java
ServiceModel.services
public static List<ServiceModel> services(BundleContext context) { List<ServiceModel> services = new ArrayList<>(); try { ServiceReference[] references = context.getAllServiceReferences(null, null); if (references != null) { for (ServiceReference ref : references)...
java
public static List<ServiceModel> services(BundleContext context) { List<ServiceModel> services = new ArrayList<>(); try { ServiceReference[] references = context.getAllServiceReferences(null, null); if (references != null) { for (ServiceReference ref : references)...
[ "public", "static", "List", "<", "ServiceModel", ">", "services", "(", "BundleContext", "context", ")", "{", "List", "<", "ServiceModel", ">", "services", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "ServiceReference", "[", "]", "references", ...
Creates the list of service models from the list of the currently available services. @param context the bundle context @return the list of models
[ "Creates", "the", "list", "of", "service", "models", "from", "the", "list", "of", "the", "currently", "available", "services", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/ServiceModel.java#L37-L50
103,592
wisdom-framework/wisdom
framework/i18n-service/src/main/java/org/wisdom/i18n/XMLResourceBundle.java
XMLResourceBundle.getKeys
public Enumeration<String> getKeys() { Set<String> handleKeys = properties.stringPropertyNames(); return Collections.enumeration(handleKeys); }
java
public Enumeration<String> getKeys() { Set<String> handleKeys = properties.stringPropertyNames(); return Collections.enumeration(handleKeys); }
[ "public", "Enumeration", "<", "String", ">", "getKeys", "(", ")", "{", "Set", "<", "String", ">", "handleKeys", "=", "properties", ".", "stringPropertyNames", "(", ")", ";", "return", "Collections", ".", "enumeration", "(", "handleKeys", ")", ";", "}" ]
Gets the keys from the wrapped properties. @return the set of key. @see java.util.ResourceBundle#getKeys()
[ "Gets", "the", "keys", "from", "the", "wrapped", "properties", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/XMLResourceBundle.java#L63-L66
103,593
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/DefaultController.java
DefaultController.logger
public Logger logger() { if (logger == null) { logger = LoggerFactory.getLogger(this.getClass().getName()); } return logger; }
java
public Logger logger() { if (logger == null) { logger = LoggerFactory.getLogger(this.getClass().getName()); } return logger; }
[ "public", "Logger", "logger", "(", ")", "{", "if", "(", "logger", "==", "null", ")", "{", "logger", "=", "LoggerFactory", ".", "getLogger", "(", "this", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "return", "logger", ";", "}...
Retrieves the logger usable by the controller. If the logger does not exist yet, get one. @return the logger.
[ "Retrieves", "the", "logger", "usable", "by", "the", "controller", ".", "If", "the", "logger", "does", "not", "exist", "yet", "get", "one", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/DefaultController.java#L52-L57
103,594
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/bodies/RenderableFile.java
RenderableFile.render
@Override public InputStream render(Context context, Result result) throws RenderableException { try { return FileUtils.openInputStream(file); } catch (IOException e) { throw new RenderableException("Cannot read file " + file.getAbsolutePath(), e); } }
java
@Override public InputStream render(Context context, Result result) throws RenderableException { try { return FileUtils.openInputStream(file); } catch (IOException e) { throw new RenderableException("Cannot read file " + file.getAbsolutePath(), e); } }
[ "@", "Override", "public", "InputStream", "render", "(", "Context", "context", ",", "Result", "result", ")", "throws", "RenderableException", "{", "try", "{", "return", "FileUtils", ".", "openInputStream", "(", "file", ")", ";", "}", "catch", "(", "IOException...
Renders the file. If just returns an empty stream on the served file. @param context the HTTP context @param result the result having built this renderable object @return the input stream. Be aware that the stream may be blocking. @throws RenderableException if the file cannot be read.
[ "Renders", "the", "file", ".", "If", "just", "returns", "an", "empty", "stream", "on", "the", "served", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/bodies/RenderableFile.java#L68-L75
103,595
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaCompilerMojo.java
JavaCompilerMojo.accept
@Override public boolean accept(File file) { return WatcherUtils.isInDirectory(file, WatcherUtils.getJavaSource(basedir)); }
java
@Override public boolean accept(File file) { return WatcherUtils.isInDirectory(file, WatcherUtils.getJavaSource(basedir)); }
[ "@", "Override", "public", "boolean", "accept", "(", "File", "file", ")", "{", "return", "WatcherUtils", ".", "isInDirectory", "(", "file", ",", "WatcherUtils", ".", "getJavaSource", "(", "basedir", ")", ")", ";", "}" ]
Checks whether or not an event on the given file should trigger the Java compilation. @param file the file @return {@literal true} if the given file is a JAva file and is contained in the Java source directory.
[ "Checks", "whether", "or", "not", "an", "event", "on", "the", "given", "file", "should", "trigger", "the", "Java", "compilation", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaCompilerMojo.java#L66-L69
103,596
wisdom-framework/wisdom
extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java
MarkdownMojo.execute
public void execute() throws MojoExecutionException { if (extensions == null || extensions.isEmpty()) { extensions = ImmutableList.of("md", "markdown"); } if (instance == null) { instance = new PegDownProcessor(Extensions.ALL); } try { ...
java
public void execute() throws MojoExecutionException { if (extensions == null || extensions.isEmpty()) { extensions = ImmutableList.of("md", "markdown"); } if (instance == null) { instance = new PegDownProcessor(Extensions.ALL); } try { ...
[ "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", "{", "if", "(", "extensions", "==", "null", "||", "extensions", ".", "isEmpty", "(", ")", ")", "{", "extensions", "=", "ImmutableList", ".", "of", "(", "\"md\"", ",", "\"markdown\"", ...
Compiles all markdown files located in the internal and external asset directories. @throws MojoExecutionException if a markdown file cannot be processed
[ "Compiles", "all", "markdown", "files", "located", "in", "the", "internal", "and", "external", "asset", "directories", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java#L71-L89
103,597
wisdom-framework/wisdom
extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java
MarkdownMojo.process
public void process(File input) throws IOException { File filtered = getFilteredVersion(input); if (filtered == null) { // It was not copied. getLog().warn("Cannot find the filtered version of " + input.getAbsolutePath() + ", " + "using source file."); ...
java
public void process(File input) throws IOException { File filtered = getFilteredVersion(input); if (filtered == null) { // It was not copied. getLog().warn("Cannot find the filtered version of " + input.getAbsolutePath() + ", " + "using source file."); ...
[ "public", "void", "process", "(", "File", "input", ")", "throws", "IOException", "{", "File", "filtered", "=", "getFilteredVersion", "(", "input", ")", ";", "if", "(", "filtered", "==", "null", ")", "{", "// It was not copied.", "getLog", "(", ")", ".", "w...
Processes the given markdown file. When the 'filtered' version of the file exists, it uses it. @param input the input file @throws IOException if the file cannot be processed.
[ "Processes", "the", "given", "markdown", "file", ".", "When", "the", "filtered", "version", "of", "the", "file", "exists", "it", "uses", "it", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java#L97-L110
103,598
wisdom-framework/wisdom
extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java
MarkdownMojo.fileDeleted
@Override public boolean fileDeleted(File file) { File output = getOutputFile(file, OUTPUT_EXTENSION); FileUtils.deleteQuietly(output); return true; }
java
@Override public boolean fileDeleted(File file) { File output = getOutputFile(file, OUTPUT_EXTENSION); FileUtils.deleteQuietly(output); return true; }
[ "@", "Override", "public", "boolean", "fileDeleted", "(", "File", "file", ")", "{", "File", "output", "=", "getOutputFile", "(", "file", ",", "OUTPUT_EXTENSION", ")", ";", "FileUtils", ".", "deleteQuietly", "(", "output", ")", ";", "return", "true", ";", "...
An accepted file was deleted - deletes the output file. @param file the file @return {@code true}
[ "An", "accepted", "file", "was", "deleted", "-", "deletes", "the", "output", "file", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-markdown-maven-plugin/src/main/java/org/wisdom/markdown/MarkdownMojo.java#L159-L164
103,599
wisdom-framework/wisdom
extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java
BrowserWatchController.bundles
@Route(method = HttpMethod.GET, uri = BROWSER_WATCH_BUNDLES) public Result bundles() { return ok(render(template)); }
java
@Route(method = HttpMethod.GET, uri = BROWSER_WATCH_BUNDLES) public Result bundles() { return ok(render(template)); }
[ "@", "Route", "(", "method", "=", "HttpMethod", ".", "GET", ",", "uri", "=", "BROWSER_WATCH_BUNDLES", ")", "public", "Result", "bundles", "(", ")", "{", "return", "ok", "(", "render", "(", "template", ")", ")", ";", "}" ]
Simple test route showing all loaded bundles, and the route of the current one @return
[ "Simple", "test", "route", "showing", "all", "loaded", "bundles", "and", "the", "route", "of", "the", "current", "one" ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java#L101-L104