Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/curtcox/JLHTTP
/ functions
Functions
145 in github.com/curtcox/JLHTTP
⨍
Functions
145
◇
Types & classes
17
↓ 35 callers
Method
get
Returns the value of the first header with the given name. @param name the header name (case insensitive) @return the header value, or null if none e
src/main/java/net/freeutils/httpserver/HTTPServer.java:1174
↓ 28 callers
Method
add
Adds a header with the given name and value to the end of this collection of headers. Leading and trailing whitespace are trimmed. @param name the he
src/main/java/net/freeutils/httpserver/HTTPServer.java:1214
↓ 25 callers
Method
addContentType
Adds a Content-Type mapping for the given path suffixes. If any of the path suffixes had a previous Content-Type associated with it, it is replaced wi
src/main/java/net/freeutils/httpserver/HTTPServer.java:2265
↓ 18 callers
Method
contains
Returns whether there exists a header with the given name. @param name the header name (case insensitive) @return whether there exists a header with
src/main/java/net/freeutils/httpserver/HTTPServer.java:1203
↓ 14 callers
Method
write
(byte[] b, int off, int len)
src/main/java/net/freeutils/httpserver/HTTPServer.java:1653
↓ 13 callers
Method
getHeaders
Returns the request headers. @return the request headers
src/main/java/net/freeutils/httpserver/HTTPServer.java:1386
↓ 11 callers
Method
sendError
Sends an error response with the given status and detailed message. An HTML body is created containing the status and its description, as well as the
src/main/java/net/freeutils/httpserver/HTTPServer.java:1796
↓ 10 callers
Method
getName
Returns this header's name. @return this header's name
src/main/java/net/freeutils/httpserver/HTTPServer.java:1132
↓ 10 callers
Method
sendHeaders
Sends the response headers with the given response status. A Date header is added if it does not already exist. If the response has a body, the Conten
src/main/java/net/freeutils/httpserver/HTTPServer.java:1689
↓ 9 callers
Method
getPath
Returns the path component of the request URI, after URL decoding has been applied (using the UTF-8 charset). @return the decoded path component of t
src/main/java/net/freeutils/httpserver/HTTPServer.java:1401
↓ 8 callers
Method
splitElements
Splits the given element list string (comma-separated header value) into its constituent non-empty trimmed elements. (RFC2616#2.1: element lists are d
src/main/java/net/freeutils/httpserver/HTTPServer.java:2516
↓ 7 callers
Method
getVirtualHost
Returns the virtual host with the given name. @param name the name of the virtual host to return, or null for the default virtual host @return
src/main/java/net/freeutils/httpserver/HTTPServer.java:1982
↓ 7 callers
Method
parseULong
Parses an unsigned long value. This method behaves the same as calling {@link Long#parseLong(String, int)}, but considers the string invalid if it sta
src/main/java/net/freeutils/httpserver/HTTPServer.java:2449
↓ 6 callers
Method
close
()
src/main/java/net/freeutils/httpserver/HTTPServer.java:1651
↓ 6 callers
Method
getBytes
Converts strings to bytes by casting the chars to bytes. This is a fast way to encode a string as ISO-8859-1/US-ASCII bytes. If multiple strings are p
src/main/java/net/freeutils/httpserver/HTTPServer.java:2683
↓ 6 callers
Method
read
()
src/main/java/net/freeutils/httpserver/HTTPServer.java:255
↓ 6 callers
Method
split
Splits the given string into its constituent non-empty trimmed elements, which are delimited by any of the given delimiter characters. This is a more
src/main/java/net/freeutils/httpserver/HTTPServer.java:2531
↓ 5 callers
Method
readLine
Reads the ISO-8859-1 encoded string starting at the current stream position and ending at the first occurrence of the LF character. @param in the str
src/main/java/net/freeutils/httpserver/HTTPServer.java:2778
↓ 4 callers
Method
addAll
Adds all given headers to the end of this collection of headers, in their original order. @param headers the headers to add
src/main/java/net/freeutils/httpserver/HTTPServer.java:1231
↓ 4 callers
Method
fill
Fills the buffer with more data from the underlying stream. @return true if there is available data for the current part, or false if the cur
src/main/java/net/freeutils/httpserver/HTTPServer.java:583
↓ 4 callers
Method
getBody
Returns the input stream containing the request body. @return the input stream containing the request body
src/main/java/net/freeutils/httpserver/HTTPServer.java:1393
↓ 4 callers
Method
getMethod
Returns the request method. @return the request method
src/main/java/net/freeutils/httpserver/HTTPServer.java:1365
↓ 4 callers
Method
getValue
Returns this header's value. @return this header's value
src/main/java/net/freeutils/httpserver/HTTPServer.java:1139
↓ 4 callers
Method
getVersion
Returns the request version string. @return the request version string
src/main/java/net/freeutils/httpserver/HTTPServer.java:1379
↓ 4 callers
Method
transfer
Transfers data from an input stream to an output stream. @param in the input stream to transfer from @param out the output stream to transfer to (or
src/main/java/net/freeutils/httpserver/HTTPServer.java:2705
↓ 4 callers
Method
trimRight
Returns the given string with all occurrences of the given character removed from its right side. @param s the string to trim @param c the character
src/main/java/net/freeutils/httpserver/HTTPServer.java:2586
↓ 3 callers
Method
addContext
Adds a context and its corresponding context handler to this server. Paths are normalized by removing trailing slashes (except the root). @param path
src/main/java/net/freeutils/httpserver/HTTPServer.java:966
↓ 3 callers
Method
formatDate
Formats the given time value as a string in RFC 1123 format. @param time the time in milliseconds since January 1, 1970, 00:00:00 GMT @return the giv
src/main/java/net/freeutils/httpserver/HTTPServer.java:2487
↓ 3 callers
Method
getContext
Returns the info of the context handling this request. @return the info of the context handling this request, or an empty context
src/main/java/net/freeutils/httpserver/HTTPServer.java:1564
↓ 3 callers
Method
getDate
Returns the Date value of the header with the given name. @param name the header name (case insensitive) @return the header value as a Date, or null
src/main/java/net/freeutils/httpserver/HTTPServer.java:1188
↓ 3 callers
Method
getHeaders
Returns the request headers collection. @return the request headers collection
src/main/java/net/freeutils/httpserver/HTTPServer.java:1613
↓ 3 callers
Method
getOutputStream
Returns the underlying output stream to which the response is written. Except for special cases, you should use {@link #getBody()} instead. @return t
src/main/java/net/freeutils/httpserver/HTTPServer.java:1621
↓ 3 callers
Method
getParams
Returns a header's parameters. Parameter order is maintained, and the first key (in iteration order) is the header's value without the parameters. @p
src/main/java/net/freeutils/httpserver/HTTPServer.java:1293
↓ 3 callers
Method
hasNext
()
src/main/java/net/freeutils/httpserver/HTTPServer.java:750
↓ 3 callers
Method
readHeaders
Reads headers from the given stream. Headers are read according to the RFC, including folded headers, element lists, and multiple headers (which are c
src/main/java/net/freeutils/httpserver/HTTPServer.java:2793
↓ 3 callers
Method
readToken
Reads the token starting at the current stream position and ending at the first occurrence of the given delimiter byte, in the given encoding. If LF i
src/main/java/net/freeutils/httpserver/HTTPServer.java:2739
↓ 3 callers
Method
send
Sends the full response with the given status, and the given string as the body. The text is sent in the UTF-8 charset. If a Content-Type header was n
src/main/java/net/freeutils/httpserver/HTTPServer.java:1776
↓ 3 callers
Method
writeTo
Writes the headers to the given stream (including trailing CRLF). @param out the stream to write the headers to @throws IOException if an error occur
src/main/java/net/freeutils/httpserver/HTTPServer.java:1277
↓ 2 callers
Method
findBoundary
Finds the first (potential) boundary within the buffer's remaining data. Updates tail, length and state fields accordingly. @throws IOException if an
src/main/java/net/freeutils/httpserver/HTTPServer.java:624
↓ 2 callers
Method
getBaseURL
Returns the base URL (scheme, host and port) of the request resource. The host name is taken from the request URI or the Host header or a default host
src/main/java/net/freeutils/httpserver/HTTPServer.java:1430
↓ 2 callers
Method
getBody
Returns an output stream into which the response body can be written. The stream applies encodings (e.g. compression) according to the sent headers. T
src/main/java/net/freeutils/httpserver/HTTPServer.java:1643
↓ 2 callers
Method
getConditionalStatus
Calculates the appropriate response status for the given request and its resource's last-modified time and ETag, based on the conditional headers pres
src/main/java/net/freeutils/httpserver/HTTPServer.java:2855
↓ 2 callers
Method
getHandlers
Returns the map of supported HTTP methods and their corresponding handlers. @return the map of supported HTTP methods and their corresponding handler
src/main/java/net/freeutils/httpserver/HTTPServer.java:817
↓ 2 callers
Method
getMethods
Returns all HTTP methods explicitly supported by at least one context (this may or may not include the methods with required or built-in support). @r
src/main/java/net/freeutils/httpserver/HTTPServer.java:933
↓ 2 callers
Method
getParentPath
Returns the parent of the given path. @param path the path whose parent is returned (must start with '/') @return the parent of the given path (exclu
src/main/java/net/freeutils/httpserver/HTTPServer.java:2572
↓ 2 callers
Method
headersSent
Returns whether the response headers were already sent. @return whether the response headers were already sent
src/main/java/net/freeutils/httpserver/HTTPServer.java:1628
↓ 2 callers
Method
initChunk
Initializes the next chunk. If the previous chunk has not yet ended, or the end of stream has been reached, does nothing. @return the length of the c
src/main/java/net/freeutils/httpserver/HTTPServer.java:339
↓ 2 callers
Method
initChunk
Initializes a new chunk with the given size. @param size the chunk size (must be positive) @throws IllegalArgumentException if size is negative @thro
src/main/java/net/freeutils/httpserver/HTTPServer.java:411
↓ 2 callers
Method
match
Matches the given ETag value against the given ETags. A match is found if the given ETag is not null, and either the ETags contain a " " value, or one
src/main/java/net/freeutils/httpserver/HTTPServer.java:2836
↓ 2 callers
Method
parseParamsList
Parses name-value pair parameters from the given "x-www-form-urlencoded" MIME-type string. This is the encoding used both for parameters passed as the
src/main/java/net/freeutils/httpserver/HTTPServer.java:2355
↓ 2 callers
Method
replace
Adds a header with the given name and value, replacing the first existing header with the same name. If there is no existing header with the same name
src/main/java/net/freeutils/httpserver/HTTPServer.java:1245
↓ 2 callers
Method
serve
Serves the given request using the given response. @param req the request to be served @param resp the response to be filled @return an HTTP status c
src/main/java/net/freeutils/httpserver/HTTPServer.java:1046
↓ 2 callers
Method
serve
Serves the content for a request by invoking the context handler for the requested context (path) and HTTP method. @param req the request @param resp
src/main/java/net/freeutils/httpserver/HTTPServer.java:2228
↓ 2 callers
Method
setPath
Sets the path component of the request URI. This can be useful in URL rewriting, etc. @param path the path to set @throws IllegalArgumentException if
src/main/java/net/freeutils/httpserver/HTTPServer.java:1412
↓ 2 callers
Method
size
Returns the number of added headers. @return the number of added headers
src/main/java/net/freeutils/httpserver/HTTPServer.java:1164
↓ 2 callers
Method
trimDuplicates
Trims duplicate consecutive occurrences of the given character within the given string, replacing them with a single instance of the character. @para
src/main/java/net/freeutils/httpserver/HTTPServer.java:2617
↓ 1 callers
Method
addContentTypes
Adds Content-Type mappings from a standard mime.types file. @param in a stream containing a mime.types file @throws IOException if an error occurs @t
src/main/java/net/freeutils/httpserver/HTTPServer.java:2277
↓ 1 callers
Method
addHandler
Adds (or replaces) a context handler for the given HTTP methods. @param handler the context handler @param methods the HTTP methods supported by the
src/main/java/net/freeutils/httpserver/HTTPServer.java:827
↓ 1 callers
Method
addVirtualHost
Adds the given virtual host to the server. If the host's name or aliases already exist, they are overwritten. @param host the virtual host to add
src/main/java/net/freeutils/httpserver/HTTPServer.java:2001
↓ 1 callers
Method
createIndex
Serves the contents of a directory as an HTML file index. @param dir the existing and readable directory whose contents are served @param path the di
src/main/java/net/freeutils/httpserver/HTTPServer.java:3010
↓ 1 callers
Method
createServerSocket
Creates the server socket used to accept connections, using the configured {@link #setServerSocketFactory ServerSocketFactory} and {@link #setPort por
src/main/java/net/freeutils/httpserver/HTTPServer.java:2015
↓ 1 callers
Method
detectLocalHostName
Returns the local host's auto-detected name. @return the local host name
src/main/java/net/freeutils/httpserver/HTTPServer.java:2329
↓ 1 callers
Method
escapeHTML
Returns an HTML-escaped version of the given string for safe display within a web page. The characters '&', '>' and '<' must always be escap
src/main/java/net/freeutils/httpserver/HTTPServer.java:2654
↓ 1 callers
Method
getAliases
Returns this host's aliases. @return the (unmodifiable) set of aliases (which may be empty)
src/main/java/net/freeutils/httpserver/HTTPServer.java:879
↓ 1 callers
Method
getContentType
Returns the content type for the given path, according to its suffix, or the given default content type if none can be determined. @param path the pa
src/main/java/net/freeutils/httpserver/HTTPServer.java:2302
↓ 1 callers
Method
getDirectoryIndex
Gets this host's directory index file. @return the directory index file, or null
src/main/java/net/freeutils/httpserver/HTTPServer.java:904
↓ 1 callers
Method
getParamsList
Returns the request parameters, which are parsed both from the query part of the request URI, and from the request body if its content type is "applic
src/main/java/net/freeutils/httpserver/HTTPServer.java:1466
↓ 1 callers
Method
getRange
Returns the absolute (zero-based) content range value read from the Range header. If multiple ranges are requested, a single range containing all of t
src/main/java/net/freeutils/httpserver/HTTPServer.java:1512
↓ 1 callers
Method
getURI
Returns the request URI. @return the request URI
src/main/java/net/freeutils/httpserver/HTTPServer.java:1372
↓ 1 callers
Method
getVirtualHost
Returns the virtual host corresponding to the requested host name, or the default host if none exists. @return the virtual host corresponding to the
src/main/java/net/freeutils/httpserver/HTTPServer.java:1553
↓ 1 callers
Method
getVirtualHosts
Returns all virtual hosts. @return all virtual hosts (as an unmodifiable set)
src/main/java/net/freeutils/httpserver/HTTPServer.java:1991
↓ 1 callers
Method
handleConnection
Handles communications for a single connection over the given streams. Multiple subsequent transactions are handled on the connection, until the strea
src/main/java/net/freeutils/httpserver/HTTPServer.java:2069
↓ 1 callers
Method
handleMethod
Handles a transaction according to the request method. @param req the transaction request @param resp the transaction response (into which the respon
src/main/java/net/freeutils/httpserver/HTTPServer.java:2174
↓ 1 callers
Method
handleTrace
Handles a TRACE method request. @param req the request @param resp the response into which the content is written @throws IOException if an error occ
src/main/java/net/freeutils/httpserver/HTTPServer.java:2211
↓ 1 callers
Method
handleTransaction
Handles a single transaction on a connection. <p> Subclasses can override this method to perform filtering on the request or response, apply wrappers
src/main/java/net/freeutils/httpserver/HTTPServer.java:2117
↓ 1 callers
Method
isAllowGeneratedIndex
Returns whether auto-generated indices are allowed. @return whether auto-generated indices are allowed
src/main/java/net/freeutils/httpserver/HTTPServer.java:923
↓ 1 callers
Method
isCompressible
Checks whether data of the given content type (MIME type) is compressible. @param contentType the content type @return true if the data is compressib
src/main/java/net/freeutils/httpserver/HTTPServer.java:2314
↓ 1 callers
Method
iterator
Returns an iterator over the headers, in their insertion order. If the headers collection is modified during iteration, the iteration result is undefi
src/main/java/net/freeutils/httpserver/HTTPServer.java:1310
↓ 1 callers
Method
join
Returns a string constructed by joining the string representations of the iterated objects (in order), with the delimiter inserted between them. @par
src/main/java/net/freeutils/httpserver/HTTPServer.java:2558
↓ 1 callers
Method
next
()
src/main/java/net/freeutils/httpserver/HTTPServer.java:758
↓ 1 callers
Method
nextPart
Advances the stream position to the beginning of the next part. Data read before calling this method for the first time is the preamble, and data read
src/main/java/net/freeutils/httpserver/HTTPServer.java:564
↓ 1 callers
Method
parseChunkSize
Parses a chunk-size line. @param line the chunk-size line to parse @return the chunk size @throws IllegalArgumentException if the chunk-size line is
src/main/java/net/freeutils/httpserver/HTTPServer.java:364
↓ 1 callers
Method
parseDate
Parses a date string in one of the supported {@link #DATE_PATTERNS}. <p> Received date header values must be in one of the following formats: Sun, 06
src/main/java/net/freeutils/httpserver/HTTPServer.java:2469
↓ 1 callers
Method
parseRange
Returns the absolute (zero-based) content range value specified by the given range string. If multiple ranges are requested, a single range containing
src/main/java/net/freeutils/httpserver/HTTPServer.java:2404
↓ 1 callers
Method
preprocessTransaction
Preprocesses a transaction, performing various validation checks and required special header handling, possibly returning an appropriate response. @p
src/main/java/net/freeutils/httpserver/HTTPServer.java:2133
↓ 1 callers
Method
readRequestLine
Reads the request line, parsing the method, URI and version string. @param in the input stream from which the request line is read @throws IOExceptio
src/main/java/net/freeutils/httpserver/HTTPServer.java:1524
↓ 1 callers
Method
redirect
Sends a 301 or 302 response, redirecting the client to the given URL. @param url the absolute URL to which the client is redirected @param permanent
src/main/java/net/freeutils/httpserver/HTTPServer.java:1849
↓ 1 callers
Method
remove
Removes all headers with the given name (if any exist). @param name the header name (case insensitive)
src/main/java/net/freeutils/httpserver/HTTPServer.java:1262
↓ 1 callers
Method
sendBody
Sends the response body. This method must be called only after the response headers have been sent (and indicate that there is a body). @param body a
src/main/java/net/freeutils/httpserver/HTTPServer.java:1824
↓ 1 callers
Method
serveFile
Serves a context's contents from a file based resource. <p> The file is located by stripping the given context prefix from the request's path, and app
src/main/java/net/freeutils/httpserver/HTTPServer.java:2906
↓ 1 callers
Method
serveFileContent
Serves the contents of a file, with its corresponding content type, last modification time, etc. conditional and partial retrievals are handled accord
src/main/java/net/freeutils/httpserver/HTTPServer.java:2940
↓ 1 callers
Method
setAllowGeneratedIndex
Sets whether auto-generated indices are allowed. If false, and a directory resource is requested, an error will be returned instead. @param allowed s
src/main/java/net/freeutils/httpserver/HTTPServer.java:914
↓ 1 callers
Method
setClientCapabilities
Sets the request which is used in determining the capabilities supported by the client (e.g. compression, encoding, etc.) @param req the request
src/main/java/net/freeutils/httpserver/HTTPServer.java:1606
↓ 1 callers
Method
setDiscardBody
Sets whether this response's body is discarded or sent. @param discardBody specifies whether the body is discarded or not
src/main/java/net/freeutils/httpserver/HTTPServer.java:1596
↓ 1 callers
Method
setPort
Sets the port on which this server will accept connections. @param port the port on which this server will accept connections
src/main/java/net/freeutils/httpserver/HTTPServer.java:1935
↓ 1 callers
Method
setServerSocketFactory
Sets the factory used to create the server socket. If null or not set, the default {@link ServerSocketFactory#getDefault()} is used. For secure socket
src/main/java/net/freeutils/httpserver/HTTPServer.java:1952
↓ 1 callers
Method
skip
(long len)
src/main/java/net/freeutils/httpserver/HTTPServer.java:273
↓ 1 callers
Method
skip
(long len)
src/main/java/net/freeutils/httpserver/HTTPServer.java:537
↓ 1 callers
Method
start
Starts this server. If it is already started, does nothing. Note: Once the server is started, configuration-altering methods of the server and its vir
src/main/java/net/freeutils/httpserver/HTTPServer.java:2030
↓ 1 callers
Method
toMap
Converts a collection of pairs of objects (arrays of size two, each representing a key and corresponding value) into a Map. Duplicate keys are ignored
src/main/java/net/freeutils/httpserver/HTTPServer.java:2384
next →
1–100 of 145, ranked by callers