RamHttpTools API Document

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

OVERVIEW PACKAGE CLASS TREE DEPRECATED INDEX HELP

PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

jakarta.servlet
Interface RamHttpTools

All Known Implementing Classes:


RAMfilingHTTPtools

public interface RamHttpTools

jakarta.servlet.RamHttpTools is an interface of org.apache.catalina.core.RAMfilingHTTPtools class.


This interface is an assistant to the Ramfile interface and the RamStringB64 interface all of which are connected to
persistent classes through the server web application context class binaries and were developed and written by Mr.
Samuel A Marchant ,
[ Wednesday, 02-12-20 14:42:02 GMT ] Sydney Australia nicephotog@gmail.com , nicephotog@yahoo.com.au
This interface is an access to http header commands
( https://tools.ietf.org/html/rfc7231 https://tools.ietf.org/html/rfc2616 https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html )
and internationalization text tools utility
( https://tools.ietf.org/html/rfc5987 https://tools.ietf.org/html/rfc8187 )
for assistance to http servlet output and http output parameters of the web / intranet server. It contains some
internationalization assistance for text character sets and Date Time
( https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html )
and their world time zones from the Java runtime JVM version.
Construction for use of both http 1.0 and 1.1 header commands and their parameters is assisted by an array of the string
data ready to manipulate.
Of much importance to http output headers "e.g. Expires" are time units such as World Time Zones and the tools to set
headers time units by specification for UA user agent caching scenarios.

For HTTP protocol information about time date formats (RFC 3339) 5.6. Internet Date/Time Format
https://tools.ietf.org/html/rfc3339 and
(RFC 1945) 3.3 Date/Time Formats https://tools.ietf.org/html/rfc1945#section-3.3
For information on custom java date-time formatting templates see class
java.time.format.DateTimeFormatter
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
note: method getzonedDateRFC1123format(java.time.ZonedDateTime ZmethodCall) returns a GMT string almost suitable for the
1.0 "expires" command and is easy to manipulate as a String.
However, TZif is not supported at this time (pardon the pun). https://tools.ietf.org/html/rfc8536 neither WebDAV (CalDAV)
https://tools.ietf.org/rfc/rfc7809.txt
Although this class is persistent AND has a global HashTable<String,String> array instantiated on application startup, it is not for
use of storing any data from servlets or jsp or other java container systems, those such problems are for web application servlet user
session or jsp user session and the loaded application's bean repository.
This class does instantiate some data on starting but is only for use with the methods in this class.
The HashTable array is for storing String elements of e.g. pre-formatted ready date-time , header command right-side values, String
templates for Date Formatter and other associate "pre determined parts" that should be (usually) loaded using the application context
listener class on application startup.
The class also contains what i call "convenience methods". These methods are made with short one or two lines of code considered to
be almost nothing that are in essence supplied by the Java API classes in context to the operations, Used here in this class it does
suggest to the programmer the type of object to use or create in the circumstance, although almost uneeded to write, however, these
methods are a point in the correct direction for use. It is also effectively a little quicker to use than actually finding a method from the
docs.
For internationalization assistance, the array of http header commands also contains single symbol elements representing many
English language programming and punctuation symbols,
these symbols can be converted to other ISO charset with the method reEncodechars() , in the interface is also a method returning a
String to output the complete array of symbol and command elements indexed with their output representation.
Below are some construct of pieces required or may be required when using reEncodechars() String ISO converter method
One of the most important benefits of encoding conversion for internationalization in HTTP comes from the problem much of
the supplied HTML page scripting and server side programming such as header output commands and value fields is required to be
constructed in ASCII character set / subset, and can be declared in an international markup page inside an element and its sub
elements to be in EN_us language with the lang= markup attribute supplied by some markup elements. This is specially useful and
practical for output of javascript DHTML from non English charset and language servers.
A note to non English coders / programmers, this works much better for .js javascript DHTML script when the script is stored in a file
external to the html / xml page and the re-encode sequence called alike / similar to below is checked by saving in a file using a byte
stream then opened in an editor sure to acknowledge the ASCII charset for correct display.
java.nio.charset.Charset defchar = java.nio.charset.Charset.defaultCharset();
String charsetInputName = defchar.name(); // get default OS system underlying base charset code page
// "UTF_8"; "GB18030" //java.nio.charset.StandardCharsets.UTF_8.name(); // "GB2312"; /// "UTF_16"; // "UTF_8"; "GB18030"
// FOLLOWING is middle hop transfer re-encode from ("GB18030") PRC Chinese simplified carrying an English subset to a (GB2312)
Web Cinese simplified with English subset
// THEN from the middle hop (GB2312) web charset to a standard English charset (UTF_8)
String charsetFrom = "GB2312";
String charsetNameto = java.nio.charset.StandardCharsets.UTF_8.name(); //"GB2312"; US_ASCII UTF_8
String charout = ramm.reEncodechars(java.util.Locale.ENGLISH,headerOrigin,"GB18030","GB2312");
charout = ramm.reEncodechars(java.util.Locale.ENGLISH,charout,charsetFrom,charsetNameto);
Included class of this interface are methods to use the internal HTTP header commands array. The header commands array is
incorporate with and as english text "symbols" array for assistance to conversion of characters in foreign ISO charsets.
They include two array element header parts string concatenator methods, a method to replace the ten basic digits "0 - 9 global Array of
digits" in one of the two supplied special concatenator methods for convenience of other ISO charset use.
NOTE: The tools in this object relating ISO charsets are not intended to replace normal custom programmed components and are an
assistance only.
The HTTP header commands array is a global final String[] array and contains a quantity of common 1.1 header commands for cache
setting and output and http 1.0 GMT string construction for "expires" header.
A note on http cookies , settings of Max-Age= and Expires= and alike keys , these are "cache mechanism" parameters , meaning
setting a long period of time while developing the code in the server or the page may not clear the previous cookie entry, so matter of
only seconds is better than a single minute as the value of the setting while testing.
See also: an associate similar mechanism javax.servlet.RamStringB64 / jakarta.servlet.RamStringB64 and
org.apache.catalina.core.RAMStringB64Array
See also: an associate similar mechanism javax.servlet.Ramfile / jakarta.servlet.Ramfile and
org.apache.catalina.core.RAMfileArray

Method Summary

All Methods Instance Methods Abstract Methods


Modifier and Type Method and Description
java.lang.String concatHttpArrayParts(int[] http1011CacheHeaderelements)

Method to join elements together of the Http commands and symbols array repository for
output http header writing. Each int is an index of the desired symbol or command drawn from
the Http commands and symbols array, int indexes of the array elements are concatenated in
sequence into a single String.

java.lang.String concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)

There is a CLAUSE with the use of this method,


Method to join elements of the Http commands and symbols array together (as a single String)
contained in the RAMfileArray class, However, Uses Strings as input notation for the indexes
to obtain ( for a brief description of purpose see
concatHttpArrayParts(int[] http1011CacheHeaderelements) )
SEE full explanation of this method below.

java.util.TimeZone constructTimeZone(java.lang.String ZoneIdString)

This method constructs a java.util.TimeZone object from an ID that is a String that is a qualified
java.util.TimeZone ID name. A qualifying TimeZone name can be obtained from the array of
TimeZone names by method getListedTimeZoneID(int indexTZ) of this class.

java.util.TimeZone constructTimeZone(java.time.ZoneId zoneIdindex)

This method constructs a java.util.TimeZone object from a java.time.ZoneId object.A ZoneId


object can be obtained directly from the pre loaded ZoneId array in this class with method
getAsZoneIDListed(int indexZID) of this class.

Note: the pre constructed arrays in this class may vary their index between versions of JVM !

java.lang.String[] getAllCountryNameText()

Returns a pre loaded String[] array of all available java.util.Locale national country display
names in the version of JVM.
java.lang.String[] getAllLanguageNameText()

Returns a pre loaded String[] array of all available java.util.Locale language display names in
the version of JVM.

java.time.OffsetDateTime getaOffSetDateTime(java.time.ZonedDateTime zoneoff)

Uses an instantiated java.time.ZonedDateTime to convert to an offset OffSetDateTime. note


there are other methods of these objects that achieve similar if not the same, however, this
method i classify as a convenience method to at least use lesser writing or be at hand.

java.time.ZoneId getAsZoneIDListed(int indexZID)

Obtains a java.time.ZoneId object from the pre loaded array of ZoneId-ID. method input
argument is the index of the element on the array.

java.time.Period getaTimeQuantity(int yrs, int mon, int dys)


int yrs = quantity of years
int mon = quantity of months
int dy = quantity of days
Creates a java.time.Period object of the specified period quantity. This is a convenience
method.

java.time.Period getaWeekQuantity(int wks)

Creates a java.time.Period object of the specified period quantity of weeks. This is a


convenience method.

java.time.ZoneId getaZoneId(int arrayIdIndexedNumber)

Almost identical to method getAsZoneIDListed(int indexZID). However is also similar to its


overloaded method with String argument version String arrayIdIndexedvalue in that it uses a
static ZoneId and method to produce the ZoneId object. The int argument is the pre loaded
array element index of ZoneId-ID's.

java.time.ZoneId getaZoneId(java.lang.String arrayIdIndexedvalue)

Uses static call ZoneId.of(String arrayIdIndexedvalue) to produce a ZoneId object. The String
arrayIdIndexedvalue argument is the name (not display name) of a ZoneId from the qualified
ZoneId names array of this class can be called by method getListedZoneID(int indexZID) or,
and more likely, an "obtained from a set object" qualified String ZoneId name from some other
source.

java.time.ZoneOffset getaZoneOffset(java.lang.String zoffoZId)

Creates a java.time.ZoneOffset qualified String name of a ZoneId object value, note that
ZoneOffset class extends ZoneId class.

java.time.ZoneOffset getaZoneOffset(java.time.ZonedDateTime zoneoff)

Creates a java.time.ZoneOffset object from an instance of a ZonedDateTime object.

java.util.Calendar getCalendar(java.util.TimeZone zone,


java.util.Locale localeFromArray)
Creates a Calendar object with the specified time zone TimeZone object's timezone. This is a
convenience method.

java.util.Locale[] getCalendarLocalesArray(java.util.Calendar dar)

Returns a pre loaded array of all available locales from this class.

java.lang.String getCreatedGMTDate(java.util.Date headerGMTdate)

Formats a java.util.Date object to a GMT String. (this method was only added as convenience)
java.lang.String[] getDigitISOTestArray()

This method is for use where


concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)
is used when another ISO charset is used for concatenation and digits. This method allows
isolating to examine the ten of 0 - 9 text digits that are used to check the input, by replacing
the String Array with an array created by the programmer.

java.lang.String getFormattedCookieDate(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum, boolean suffixTimeTypeUtcGmt)
boolean suffixTimeTypeUtcGmt = GMT or UTC as the suffix
Returns a cookie formatted time in GMT system suitable for expires= in a cookie.
java.lang.String getHttpPartsArrayElement(int idxsymb)

This method brings back a single element String of the http header main symbols and
commands utility array.

java.lang.String getHttpPartsFullArrayLegend(boolean line)

This method is a documentation printout tool. Brings back a String of "all elements" in the http
commands and symbols array for printing to a page using a servlet.

java.lang.String getHttpPartsSymbolArrayLegend(boolean line)

This method is a documentation printout tool. Brings back a String of "single character symbol
elements initially in the class compiled UTF_8" for printing to a page using a servlet.

java.time.Instant getInstantFromCalendar(java.util.TimeZone zone,


java.util.Locale localeFromArray)
Uses the method getCalendar(TimeZone zone, Locale localeFromArray) of this class to convert
an immediately instantiated Calendar object to a java.time.Instant object.

java.util.Enumeration getkeysForStoredDateStrings()

Returns an Enumeration object of all the "unique identifier Keys" present in the global storage
HashTable<String,String> array..

java.lang.String getLineCRLF()

Returns a newline character, either a default machine string "newline character" has been set
or the compliment set method of this get method can be used to custom set a "newline
character".

java.lang.String getListedCountryLocaleCode(int indexZID)

Returns a String element of the two letter Locale national Country code of the pre loaded
Locale array by int index.

java.lang.String[] getListedCountryLocaleCodeArray()

Returns a String[] array of the two letter Locale codes of the pre loaded array of Locale objects.

java.lang.String getListedCountryNameText(int indexZID)

Gets a String value of the "displayable name" of an element on the pre loaded Locale array.

java.lang.String getListedLanguageLocaleCode(int indexZID)

Returns a String element of the "two letter Locale" language code pre loaded array by int index
argument.

java.lang.String[] getListedLanguageLocaleCodeArray()

Returns a String[] array of the two letter Locale language codes of the pre loaded array of
Locale objects.
java.lang.String getListedLanguageNameText(int indexZID)

Gets the human readable displayable name of the locale language code of the pre loaded
locale array.

java.lang.String getListedTimeZoneID(int indexTZ)

Obtains a TimeZone object ID from the pre loaded array of TimeZone ID's.

java.lang.String getListedZoneID(int indexZID)

Gets a ZoneID as a qualified name String reference object from the pre loaded array of ID's
stored in this class.

java.lang.String getlocalDateANSIformat(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum)
Formats a LocalDateTime object according RFC1945 ANSI time.
Example: Wed Sep 16 12:31:02 2020

java.lang.String getlocalDateRFC1123format(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum)
Formats a LocalDateTime object according RFC1123.
This method has been repaired and given the extra input argument for Locale for its
String format, it now uses a custom template and GMT suffix
Example: Wed, 04 Nov 2020 18:31:02 GMT

java.time.Clock getNowUTCclockInstance()

Obtain a UTC Clock object from the System.

java.lang.String getStoredDateString(java.lang.String keyItemname)

This method returns a HashTable<String,String> element value stored String by access to the
RAMfilingHTTPtools class dates, header-parts, formatted times global String storage array, the
array is created at application startup. The argument passed to the method is a String unique
name to identify the stored item on the HashTable array.

int getStoredDateStringsSize()

Returns the int total quantity of all the elements (pairs) present in the global storage
HashTable<String,String> array.

java.lang.String getTestSpaceToken()

get the test space token that is set for use in the
concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements) string elements joiner
method.

java.lang.String getTimeZoneIdPrintOut(boolean newlHtml)

Printout documentation tool of the TimeZone array indexes and values of TimeZone class
objects (principally its string ID's).

java.lang.String[] getTimeZoneNameTextArray()

Printout documentation tool of the TimeZone array indexes and values of TimeZone class
objects (principally its string DISPLAY NAMES).
Before obtaining any text array from the actual JRE API !(not from this class - this class is
loaded in default Locale)
The time and zone java api classes do have methods to input locale onto displayable text
objects and translate , aside the fact these arrays are loaded in default locale.
It is possible to change locale on the "text display names index" array call from the JRE
binaries itself and obtain DISPLAY NAMES IN THERE OWN "script" and "language
(translation)"
However, do not forget that to render these the User Agent will require both a suitable charset
and font to display them and too the correct HTML element lang= attributes.
java.lang.String getTimeZoneNameTextIndex(int indexZID)

Get a display name from the TimeZone array by its index as a String array element.

UAhttpCookie getUAClientCookieManager()

Obtains the interface for the UserAgent Cookie Manager class , for storage and
construction of HTTP cookies as a special "cookie object class" and cookie templates as
a cookie class.

java.lang.String getUTClocalDateRFC1123format(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum) (java.time.LocalDateTime mayBeUTC, java.util.Locale locum)
Same as getlocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum) this
last method is compliant with expires header,
This method simply is alternate of "gmt" version and uses UTC as the suffix.
EXAMPLE: Wed, 04 Nov 2020 14:41:22 UTC

java.time.ZonedDateTime getzonedClockinstant(java.time.Clock clock) (java.time.Clock clock)

Converts an instantiated Clock object to a ZonedDateTime.

java.lang.String getzonedDateFormatted(java.time.ZonedDateTime ZmethodCall,


java.lang.String pattern, java.util.Locale lcal)
Obtains a java.time.ZonedDateTime object from a Clock instance argument clock.

java.lang.String getzonedDateRFC1123format(java.time.ZonedDateTime ZmethodCall,


java.util.Locale locum)
Date Time formatted to RFC1123 standard, except it carries a zone offset and has no final
GMT suffix.
Example: Wed, 4 Nov 2020 18:31:02 +0800

java.lang.String getzonedDateUTCformat(java.time.ZonedDateTime mustBeUTC,


java.util.Locale locum)
Formats a UTC Date Time object instance of a java.time.ZonedDateTime with
DateTimeFormatter.ISO_INSTANT
EXAMPLE: 2020-11-04T06:28:27.065Z
This should not be confused with an HTTP cookie using a localdatetime with either GMT
format or GMT with a UTC suffix !
see also getUTClocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum)
and getlocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum) this last
method is compliant with expires header.

java.lang.String getZoneIDListedNameText(int indexZID)

Gets a fully qualified ZoneId human readable string display name from the pre loaded array by
int index.

java.lang.String[] getZoneIDNameTextArray()

Gets the complete pre loaded array of human readable string display names.

java.lang.String getZoneIdPrintOut(boolean newlHtml)

Print out tool. Print out of pre loaded ZoneId array elements "representations".

boolean isStoredDateStringKeyNamePresent(java.lang.String keyItemname) Test to


find if this class String storage HashTable array "key" exists.
java.time.ZonedDateTime minusTimeDays(java.time.ZonedDateTime adjt, int amo)

Negate time setting in units of days on the acquired ZonedDateTime.

java.time.ZonedDateTime minusTimeMonths(java.time.ZonedDateTime adjt, int amo)

Negate time setting in units of months on the acquired ZonedDateTime.


java.time.ZonedDateTime minusTimeWeeks(java.time.ZonedDateTime adjt, int amo)

Negate time setting in units of weeks on the acquired ZonedDateTime.

java.time.OffsetDateTime nowOffsetZonedTime(java.time.ZoneId izd)

Grabs the time from the system clock and directly creates a java.time.OffsetZonedTime object
of it in the ZoneId argument TimeZone.

java.time.ZonedDateTime nowZoneDateTime()

Grabs the time from the system clock and directly creates a java.time.ZonedDateTime object
of it.

java.time.ZonedDateTime nowZoneDateTime(java.lang.String zoneIDname)

Grabs the time from the system clock and directly creates a java.time.ZonedDateTime object
of it adjusting it to the basic zone time supplied by the ZoneId argument.

java.util.Date obtainHeaderDate(java.time.LocalDateTime timeset)

Convert an instantiated java.time.LocalDateTime object to a java.util.Date object.

java.time.temporal.TemporalAmount periodToTemporalAmount(java.time.Period thaim)


Converts a Period object to a TemporalAmount. (much of blocks / chunks of time can be
handled by Period and Temporal systems of the Java time date-time API).

java.lang.String pingMessageTest()

Returns a String message of version and particulars as output about the RAMfilingHTTPtools
class object for test and debug purpose.

java.time.ZonedDateTime plusTimeDays(java.time.ZonedDateTime adjt, int amo)

Addecrative , add to time setting in units of days on the acquired java.time.ZonedDateTime.

java.time.ZonedDateTime plusTimeMonths(java.time.ZonedDateTime adjt, int amo)

Addecrative , add to time setting in units months on the acquired java.time.ZonedDateTime.

java.time.ZonedDateTime plusTimeWeeks(java.time.ZonedDateTime adjt, int amo)

Addecrative , add to time setting in units of weeks on the acquired java.time.ZonedDateTime.

java.lang.String printLocalesCountryCalendar()

Printout tool for the pre loaded Locale[] array, it prints ... [ index on the array ] [ two letter
language code ] [ two letter country code ] [ display name ]

void putStoredDateString(java.lang.String keyItemname,


java.lang.String storedvalue)
Adds a HashTable element <String,String> "key" , "value" pair for storage on the
RAMfilingHTTPtools class dates, header-parts, formatted times global String storage array.
In some way the information you store should be relevent to the operations and procedures in
this class, so "key" names for the array are better "prefixed" for their usage-type and numbered
e.g. (suggestion - key name and use indication)
"@timedateGMT" + number
"@timedateUTC" + number
"@#timepattern" + number
"##stringpattern" + number
"::responsecommand" + number
":-responsecommvalue" + number
"$!localemessage" + number
":/url" + number
":/serverdomain" + number
java.lang.String reEncodechars(java.util.Locale locum, java.lang.String headerOrigin,
java.lang.String charsetInputName, java.lang.String charsetnameto)
java.lang.String headerOrigin, java.lang.String charsetInputName,
java.lang.String charsetnameto)
Method to re-encode characters to other web ISO charset or charset Alias with locale markers
/ format. (see full description below).

void removeStoredDateString(java.lang.String keyItemname)

Removes a HashTable pre-set element <String,String> key value pair from storage on the
RAMfilingHTTPtools class dates, header-parts, formatted times global String storage array.

void replaceStoredDateString(java.lang.String keyItemname,


java.lang.String storedvalue)
Replaces a HashTable pre-set element <String,String> key value pair for storage on the
RAMfilingHTTPtools class dates, header-parts, formatted times global String storage array.

void setDigitISOTestArray(java.lang.String[] iso_Digit_charArray)

This method is for use where


concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)
is used when another ISO charset is used for concatenation and digits. This method allows
changing the ten of 0 - 9 text digits that are used to check the input, by replacing the String
Array with an array created by the programmer.

void setLineCRLF(java.lang.String CR_LFin)

sets a new line character according to chosen requirement.

void setTestSpaceToken(java.lang.String spaceSymbolChar)

Sets a character token other than a text space (text break space) for use as alternative to a
leading space character when recognizing input argument String literals that are input to
concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)

int testIndexIDTimeZoneMatch(java.util.TimeZone timezone)

Matches an input variable to the value of a TimeZone ID on the pre loaded array of time zone
ID's.
returns -1 if no match is made.

int testIndexLocaleCountryCodeMatch(java.util.Locale locun)

Matches an input Locale object variable to the value of a two letter Locale "country code" on
the pre loaded array of Locale[] objects.
returns -1 if no match is made.

int testIndexLocaleLanguageMatch(java.util.Locale lolang)

Matches an input Locale object variable to the value of a two letter Locale "language code" on
the pre loaded array of Locale[] objects.
returns -1 if no match is made.

int testZoneIdMatch(java.time.ZoneId zonon)

Compares two zone Id objects.


returns -1 if no match is made.

java.lang.String urlCoder(java.lang.String cookieStr)

Uses java.net.URLEncoder.encode(String to encode, "UTF_8");


java.lang.String urlCoder(java.lang.String cookieStr,
java.lang.String charsetEncoding)
Uses java.net.URLEncoder.encode(String to encode, String the charset alias or name required
);

java.lang.String urlDeCoder(java.lang.String cookieStr)

Uses java.net.URLDecoder.decode(String to decode, "UTF_8");

java.lang.String urlDeCoder(java.lang.String cookieStr,


java.lang.String charsetEncoding)
Uses java.net.URLDecoder.decode(String to decode, String the charset alias or name required
);

java.time.Clock zoneInstantClock(java.time.ZoneId zn)

Uses the system clock instant to obtain and adjust the current time to another zone and return
it as a Clock object.

Method Detail

urlDeCoder

java.lang.String urlDeCoder(java.lang.String cookieStr)

urlCoder

java.lang.String urlCoder(java.lang.String cookieStr)

urlDeCoder

java.lang.String urlDeCoder(java.lang.String cookieStr,


java.lang.String charsetEncoding)

urlCoder

java.lang.String urlCoder(java.lang.String cookieStr,


java.lang.String charsetEncoding)

getFormattedCookieDate

java.lang.String getFormattedCookieDate(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum,
boolean suffixTimeTypeUtcGmt)

getUAClientCookieManager

UAhttpCookie getUAClientCookieManager()

getStoredDateString

java.lang.String getStoredDateString(java.lang.String keyItemname)


This method returns a HashTable<String,String> element value stored String by access to the RAMfilingHTTPtools class dates,
header-parts, formatted times global String storage array, the array is created at application startup. The argument passed to the
method is a String unique name to identify the stored item on the HashTable array.
(note that there is a good idea to prefix your keys with a character symbol as the first character (alike a geographic map "Legend
symbol") to denote their purpose to clearly identify and check that the correct type of information is being obtained when the get
method draws information from the array)

putStoredDateString

void putStoredDateString(java.lang.String keyItemname,


java.lang.String storedvalue)
Adds a HashTable element <String,String> key value pair for storage on the RAMfilingHTTPtools class dates, header-parts,
formatted times global String storage array.
(note that there is a good idea to prefix your keys with a character symbol as the first character (alike a geographic map "Legend
symbol") to denote their purpose to clearly identify and check that the correct type of information is being obtained when the get
method draws information from the array)

replaceStoredDateString

void replaceStoredDateString(java.lang.String keyItemname,


java.lang.String storedvalue)
Replaces a HashTable pre-set element <String,String> key value pair for storage on the RAMfilingHTTPtools class dates, header-
parts, formatted times global String storage array.

removeStoredDateString

void removeStoredDateString(java.lang.String keyItemname)


Removes a HashTable pre-set element <String,String> key value pair from storage on the RAMfilingHTTPtools class dates,
header-parts, formatted times global String storage array.

getkeysForStoredDateStrings

java.util.Enumeration getkeysForStoredDateStrings()
Returns an Enumeration object of all the "unique identifier Keys" present in the global storage HashTable<String,String> array.
(note that there is a good idea to prefix your keys with a character symbol as the first character (alike a geographic map "Legend
symbol") to denote their purpose to clearly identify and check that the correct type of information is being obtained when the get
method draws information from the array)

getStoredDateStringsSize

int getStoredDateStringsSize()
Returns the int total quantity of all the elements (pairs) present in the global storage HashTable<String,String> array.

isStoredDateStringKeyNamePresent

boolean isStoredDateStringKeyNamePresent(java.lang.String keyItemname)

printLocalesCountryCalendar

java.lang.String printLocalesCountryCalendar()
Printout tool for the pre loaded Locale[] array, it prints ... [ index on the array ] [ two letter language code ] [ two letter country
code ] [ display name ]
A number of parameters make a complete locale object, the two main parameters are "Language" and "Country". These are
displayed in English with their Locale object array index.
This array of Locales is created in the constructor of the org.apache.catalina.core.RAMfilingHTTPtools class, using a Calendar
object. The Array of this printout may vary depending the "explicit" JVM runtime "versio"n used.
Also note that this is stored by the API as an array in its origin not a Set or Map or List or any other Enumeration type.
getCalendarLocalesArray

java.util.Locale[] getCalendarLocalesArray(java.util.Calendar dar)


A complete identical copy of this array of Locales is created in the constructor of the
org.apache.catalina.core.RAMfilingHTTPtools class, using a Calendar object.
This array is obtained directly from the Calendar object.

getNowUTCclockInstance

java.time.Clock getNowUTCclockInstance()
Returns a UTC clock with the time set at this instant moment of call.

zoneInstantClock

java.time.Clock zoneInstantClock(java.time.ZoneId zn)


Returns a Clock object in standard time system intialised on a Time Zone argument zn by a ZoneId object reference.

getzonedClockinstant

java.time.ZonedDateTime getzonedClockinstant(java.time.Clock clock)


Obtains a java.time.ZonedDateTime object from a Clock instance argument clock.

getzonedDateFormatted

java.lang.String getzonedDateFormatted(java.time.ZonedDateTime ZmethodCall,


java.lang.String pattern,
java.util.Locale lcal)
Returns a Date and Time viewable / readable String in the Locale required using an input template pattern.
See https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html
for information on format patterns.

ZmethodCall The Date and Time information object to extract data from to format to a view
pattern, Pattern template to show each section and symbol in the Date and Time
lcal Locale to format the String to

getzonedDateRFC1123format

java.lang.String getzonedDateRFC1123format(java.time.ZonedDateTime ZmethodCall,


java.util.Locale locum)
Date Time formatted to RFC1123 standard, except it carries a zone offset and has no final GMT suffix.
Example: Wed, 4 Nov 2020 18:31:02 +0800

getlocalDateRFC1123format

java.lang.String getlocalDateRFC1123format(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum)
LocalDateTime formatted to RFC1123 standard,
EXAMPLE: Wed, 04 Nov 2020 14:41:22 GMT
This method has been repaired and given the extra input argument for Locale for its String format, it now uses a
custom template
For reasons unknown to me the LocalDateTime object would not be formatted by the pre-made formatter object
template , however the pre-made template is used with ZonedDateTime getZonedDateRFC1123format() and operates
to some specification

Example: Wed, 04 Nov 2020 18:31:02 GMT


getUTClocalDateRFC1123format

java.lang.String getUTClocalDateRFC1123format(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum)
Same as getlocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum) this last method is compliant with
expires header,
This method simply is alternate of "gmt" version and uses UTC as the suffix.
EXAMPLE: Wed, 04 Nov 2020 14:41:22 UTC

getlocalDateANSIformat

java.lang.String getlocalDateANSIformat(java.time.LocalDateTime ZmethodCall,


java.util.Locale locum)
Formats a LocalDateTime object according RFC1945 "ANSI C" time format.
EXAMPLE: Wed Nov 4 14:28:27 2020
This is compliant with http response headers.

nowOffsetZonedTime

java.time.OffsetDateTime nowOffsetZonedTime(java.time.ZoneId izd)


Uses the system clock to create an OffsetDateTime set to a Timezone by a ZoneId object.

getzonedDateUTCformat

java.lang.String getzonedDateUTCformat(java.time.ZonedDateTime mustBeUTC,


java.util.Locale locum)
Formats a UTC Date Time object instance of a java.time.ZonedDateTime with DateTimeFormatter.ISO_INSTANT
EXAMPLE: 2020-11-04T06:28:27.065Z
This should not be confused with an HTTP cookie using a localdatetime with either GMT format or GMT with a UTC suffix !
see also getUTClocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum) and
getlocalDateRFC1123format(LocalDateTime ZmethodCall,java.util.Locale locum) this last method is compliant with expires
header.

getCalendar

java.util.Calendar getCalendar(java.util.TimeZone zone,


java.util.Locale localeFromArray)
Obtains a Calendar Object set to a TimeZone and specific Locale.

getInstantFromCalendar

java.time.Instant getInstantFromCalendar(java.util.TimeZone zone,


java.util.Locale localeFromArray)
Similar to getCalendar(java.util.TimeZone zone, java.util.Locale localeFromArray)
Obtains a Calendar Object set to a TimeZone and specific Locale but returns it as a java.time.Instant object.

getListedTimeZoneID

java.lang.String getListedTimeZoneID(int indexTZ)


Obtains a qualifying String version of a TimeZone object from the pre loaded TimeZone[] array of this class.

getTimeZoneIdPrintOut

java.lang.String getTimeZoneIdPrintOut(boolean newlHtml)


Print out tool of all String version qualified TimeZone object id's on the pre loaded TimeZone[] objects array.
getListedZoneID

java.lang.String getListedZoneID(int indexZID)


Gets a fully qualified ZoneId name String from the pre loaded array by int index.

getAsZoneIDListed

java.time.ZoneId getAsZoneIDListed(int indexZID)


Gets a ZoneId object from the pre loaded array by int index.

getZoneIDListedNameText

java.lang.String getZoneIDListedNameText(int indexZID)


Gets a fully qualified ZoneId human readable string display name from the pre loaded array by int index.

getZoneIDNameTextArray

java.lang.String[] getZoneIDNameTextArray()
Gets the complete pre loaded array of human readable string display names.

getListedCountryLocaleCodeArray

java.lang.String[] getListedCountryLocaleCodeArray()
Gets the complete pre loaded array of human readable string Locale object "national country codes".

getListedCountryLocaleCode

java.lang.String getListedCountryLocaleCode(int indexZID)


Gets from the pre loaded array of Locale[] "by int index" a national country code.

getListedCountryNameText

java.lang.String getListedCountryNameText(int indexZID)


Gets from the pre loaded array of Locale[] "by int index" a national country displayable NAME.

getAllCountryNameText

java.lang.String[] getAllCountryNameText()
Gets the complete pre loaded array[] of human readable string Locale object "national country NAMES".

getListedLanguageLocaleCodeArray

java.lang.String[] getListedLanguageLocaleCodeArray()
Gets the complete pre loaded array[] of language codes.

getListedLanguageLocaleCode

java.lang.String getListedLanguageLocaleCode(int indexZID)


Gets from the pre loaded array of Locale language codes "by argument int indexZID" a code from that index.

getListedLanguageNameText

java.lang.String getListedLanguageNameText(int indexZID)


Gets from the pre loaded array of Locale language displayable names "by argument int indexZID" a name from that index.
getAllLanguageNameText

java.lang.String[] getAllLanguageNameText()
Returns an array of all Language names from each locale.

getZoneIdPrintOut

java.lang.String getZoneIdPrintOut(boolean newlHtml)


Printout tool for use in a debug servlet, all the fully qualified ZoneId names.

nowZoneDateTime

java.time.ZonedDateTime nowZoneDateTime()
Gets a java.time.ZonedDateTime directly from the system clock at that moment.

nowZoneDateTime

java.time.ZonedDateTime nowZoneDateTime(java.lang.String zoneIDname)


Gets a java.time.ZonedDateTime directly from the system clock at that moment adjusted by a qualified ZoneId name.

getTimeZoneNameTextArray

java.lang.String[] getTimeZoneNameTextArray()
Gets the Pre loaded array[] of TimeZone object displayable names.
(There is a minor difference between a TimeZone and ZoneId)

getTimeZoneNameTextIndex

java.lang.String getTimeZoneNameTextIndex(int indexZID)


Gets a single element from the pre loaded array[] of TimeZone object displayable names.

constructTimeZone

java.util.TimeZone constructTimeZone(java.lang.String ZoneIdString)


Makes a TimeZone object from a fully qualified TimeZone-ID name.

constructTimeZone

java.util.TimeZone constructTimeZone(java.time.ZoneId zoneIdindex)


Makes a TimeZone object from a fully qualified java.time.ZoneId object.

getaZoneId

java.time.ZoneId getaZoneId(java.lang.String arrayIdIndexedvalue)


Obtain a single element ZoneId object from the pre loaded array of ZoneID qualified names.
This is a good example of a "convenience method". This method uses the static ZoneId API method call of() in this following short
line to produce a ZoneID
ZoneId.of(arrayIdIndexedvalue)

getaZoneId

java.time.ZoneId getaZoneId(int arrayIdIndexedNumber)


Obtain a single element ZoneId object from the pre loaded array of ZoneID objects.

getaZoneOffset
java.time.ZoneOffset getaZoneOffset(java.lang.String zoffoZId)

getaZoneOffset

java.time.ZoneOffset getaZoneOffset(java.time.ZonedDateTime zoneoff)

getaOffSetDateTime

java.time.OffsetDateTime getaOffSetDateTime(java.time.ZonedDateTime zoneoff)


Gets the corresponding ZoneOffset object of a java.time.ZonedDateTime.

getaTimeQuantity

java.time.Period getaTimeQuantity(int yrs,


int mon,
int dys)
Create a "time quantity object" java.time.Period in units of years months and days.

getaWeekQuantity

java.time.Period getaWeekQuantity(int wks)


Create a "time quantity object" java.time.Period in units of weeks.

periodToTemporalAmount

java.time.temporal.TemporalAmount periodToTemporalAmount(java.time.Period thaim)


Create a TemporalAmount from a period to make it easier to add to a Temporal.

obtainHeaderDate

java.util.Date obtainHeaderDate(java.time.LocalDateTime timeset)


Convert an instantiated java.time.LocalDateTime object to a java.util.Date object. A newly instantiated Date object has its year set
to 1900. The methods to adjust java.util.Date objects are sufficient for the purpose of this object, no methods are supplied by this
interface for java.util.Date except a deprecated method for convenience and awareness to convert to a GMT string format.

getCreatedGMTDate

java.lang.String getCreatedGMTDate(java.util.Date headerGMTdate)


Brings back a String GMT formatted for placement in an expires header. The methods to manipulate the date in various ranges
while a java.time.LocalDateTime are here in this interface for Day, Week, Month, form. After resetting a java.time.LocalDateTime
(e.g. from systenTimeNow()) it should be converted to a java.util.Date to manipulate the hours seconds and minutes (a method for
this is also present in this interface).

plusTimeDays

java.time.ZonedDateTime plusTimeDays(java.time.ZonedDateTime adjt,


int amo)
Addecrative , add to time setting in units of days on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired
from the system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

plusTimeWeeks

java.time.ZonedDateTime plusTimeWeeks(java.time.ZonedDateTime adjt,


int amo)
Addecrative , add to time setting in units of weeks on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired
from the system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

plusTimeMonths

java.time.ZonedDateTime plusTimeMonths(java.time.ZonedDateTime adjt,


int amo)
Addecrative , add to time setting in units of months on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired
from the system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

minusTimeDays

java.time.ZonedDateTime minusTimeDays(java.time.ZonedDateTime adjt,


int amo)
Negate time setting in units of days on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired from the
system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

minusTimeWeeks

java.time.ZonedDateTime minusTimeWeeks(java.time.ZonedDateTime adjt,


int amo)
Negate time setting in units of weeks on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired from the
system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

minusTimeMonths

java.time.ZonedDateTime minusTimeMonths(java.time.ZonedDateTime adjt,


int amo)
Negate time setting in units of months on the acquired java.time.ZonedDateTime. ZonedDateTime is usually acquired from the
system clock. There is a method in this interface to bring back the current time as java.time.ZonedDateTime.

testZoneIdMatch

int testZoneIdMatch(java.time.ZoneId zonon)


Find the Pre loaded java.time.ZoneId object "index" that matches the input java.time.ZoneId object to test.
If this method is successful the pre loaded array index number in this class will be returned.
If it cannot find a match then -1 is returned.

testIndexIDTimeZoneMatch

int testIndexIDTimeZoneMatch(java.util.TimeZone timezone)


Find the Pre loaded java.util.TimeZone object "index" that matches the input argument java.util.TimeZone object to test.
If this method is successful the pre loaded array index number in this class will be returned.
If it cannot find a match then -1 is returned.

testIndexLocaleCountryCodeMatch

int testIndexLocaleCountryCodeMatch(java.util.Locale locun)


Find the Pre loaded Locale objects' "index" for "Country letter code" that matches the input argument Locale object to test.
If this method is successful the pre loaded array index number in this class will be returned.
If it cannot find a match then -1 is returned.

testIndexLocaleLanguageMatch
int testIndexLocaleLanguageMatch(java.util.Locale lolang)
Find the Pre loaded Locale objects' "index" for "Language letter code" that matches the input argument Locale object to test.
If this method is successful the pre loaded array index number in this class will be returned.
If it cannot find a match then -1 is returned.

setTestSpaceToken

void setTestSpaceToken(java.lang.String spaceSymbolChar)


Sets a character token other than a text space (text break space) for use as alternative to a leading space character when
recognizing input argument String literals that are input to
concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)

getTestSpaceToken

java.lang.String getTestSpaceToken()
Retrieve the test space token that is set for use in the concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)
string elements joiner method.

setLineCRLF

void setLineCRLF(java.lang.String CR_LFin)


sets a new line character according to chosen requirement.

getLineCRLF

java.lang.String getLineCRLF()
Retrieves a newline character, either a default machine string "newline character" has been set or the compliment set method of
this get method can be used to custom set a "newline character".

setDigitISOTestArray

void setDigitISOTestArray(java.lang.String[] iso_Digit_charArray)


Replaces the default specialised test text digits array with another ISO String[] array.
OINLY This method is for use where concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements) is used
when another ISO charset is used for concatenation and String NUMBER digits. This method allows changing the ten text
digits 0 - 9 that are used to check the text input before conversion to Integer objects then int, by replacing the test template
comparison String Array with an different ISO CHARSET String[] array created by the programmer. The elements must be
written starting from zero and in sequence to nine as a ten element String[] array.

getDigitISOTestArray

java.lang.String[] getDigitISOTestArray()
returns the numbers with 0 through to inclusive 9 that are used to test the String text numbers written elements of the String[]
array argument to method concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)

This array can be replaced with a String[] array of a different ISO character set and be persistent throughout the life-cycle of the
application that loaded this class.

concatHttpArrayParts

java.lang.String concatHttpArrayParts(java.lang.String[] http1011CacheHeaderelements)


There is a CLAUSE with the use of this method,
Method to join elements of the Http commands and symbols array together (as a single String) , the array is contained in the
RAMfileArray class, it uses Strings in a String[] argument input as notation for the element indexes to obtain ( for a brief
description of purpose see concatHttpArrayParts(int[] http1011CacheHeaderelements) )
Each String entry of the input argument array is an index of the desired symbol or command drawn from the array, but unlike the
other concatenation method in this interface, in this method the int's (element indexes to acquire) are written as String objects in a
String[] array without any other symbols or space allowed to denote "an index of" the http commands and symbols "array".
However, any String element entry of the array that has a leading space in the String will not be treated as an int index to
obtain an element from the http Symbols and Commands array. it will be used as an extra "String lieral" to insert to the
join in the array sequence...
See following clause for inserting a literal amongst the element denotations in the input argument array of this
concatenation method:

Note: by default the leading left single character to represent a literal not an array index number, is a " " single space (break
space)
1. it will be treated as a String LITERAL,
2. The leading space on the left of the String entry will be stripped off by one single character (the String "array
element literal" beginning denotation, the space token getTestSpaceToken())( SEE methods getTestSpaceToken()
setTestSpaceToken(String) setDigitISOTestArray(String[]) ) (if there are more spaces they will remain as part of the
String literal e.g. if you want a space to lead on the literal it requires two spaces because one will be removed to
recognose the element is not for conversion to digit but an insert in sequence)
3. Any digits within the String index array entry with a leading space character are text symbols and not processed.

int indexes (as String digits) for purpose are written in the sequence of desired joint together one after the other, into the method
input argument String literals array, they then are placed as an String[] array into the input argument to be converted to int.

*Although a space on the left of the input string element argument is required to denote the element to be a string
literal, this token character (the space) can be changed by setting it to another character for use to denote the
element as a literal.
See getTestSpaceToken() and setTestSpaceToken(java.lang.String spaceSymbolChar)

concatHttpArrayParts

java.lang.String concatHttpArrayParts(int[] http1011CacheHeaderelements)


Method to join elements together of the Http commands and symbols array repository for output header writing contained in the
RAMfileArray class. Each int is an index of the desired symbol or command drawn from the Http commands and symbols array, int
indexes of the array. Elements are concatenated in desired sequence of join one after the other into a single String.

getHttpPartsArrayElement

java.lang.String getHttpPartsArrayElement(int idxsymb)


This method obtains a single element String of the http header main symbols and commands utility array as denoted by
int idxsymb the index of the element to obtain. Main utility tool array containing both single symbols in UTF_8 and http 1.0 and
1.1 header commands. See both getHttpPartsFullArrayLegend() and getHttpPartsSymbolArrayLegend() tool methods.

getHttpPartsFullArrayLegend

java.lang.String getHttpPartsFullArrayLegend(boolean line)


This method is a printout tool. Brings back a String of "all elements" in the http commands and symbols array for printing to a
page using a servlet.
This method is a support tool of the object for its programmer user.
boolean line true will join the elements for printout with an html paragraph tag, false will join the elements with a double new line
character.

getHttpPartsSymbolArrayLegend

java.lang.String getHttpPartsSymbolArrayLegend(boolean line)


This method is a printout tool. Brings back a String of "single character symbol elements initially in the class compiled UTF_8" for
printing to a page using a servlet. This method is a support tool of the object for its programmer user.
boolean line true will join the elements for printout with an html paragraph tag, false will join the elements with a double new line
character.

reEncodechars
java.lang.String reEncodechars(java.util.Locale locum,
java.lang.String headerOrigin,
java.lang.String charsetInputName,
java.lang.String charsetnameto)
locum The Locale object that represents the Country and Language symbols the string is to be converted "to" (or "is" if it is
inside a different language and locale ISO charset subset as origin)
charsetInputName The string "input ISO name" that is to be converted
headerOrigin The input string to be converted
charsetnameto The name or alias of a charset to convert to

(note: "This method may need to be called twice for proper conversion to occur", with the first call to a more common language
ISO of its original language ISO that recognises ASCII characters more commonly for its purpose as an intermediate language,
then from that language to the english. SEE above page introduction for an example)

This method is for "International Web ISO charsets" to change and make use of Strings that are encoded in english in the RAM
file object or server or other programs, it is intended to help "clean" the strings to another ISO such as input file-name list for
loading if ever required. Hopwever, it must be instigated manually.
To use it will require an understnding of code pages and ISO charset alias.
Defined for Java here:
https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
Many foreign language servers have an ISO charset apart UTF_8 or UTF_16 or variants of these that carry a subset of US_ASCII
for the various web server additives such as javascript. One example of this is simplified Chinese "GB2312" , in essence Chinese
language characters but a normal English ascii string will be less troublesome carried in the "GB2312" although it is numerically
identical in its byte value.
"GB18030" is a PRC Chinese version that carries ASCII subset of english but does not convert well, so a middle hop into
"GB2312" first then re encoded into UTF_8 or ISO_8859_1 English locale format.
See also java.nio.charset.StandardCharsets and the java.util.Locale static variables for countries (ISO 636)
https://www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html
https://www.oracle.com/technical-resources/articles/javase/locale.html

pingMessageTest

java.lang.String pingMessageTest()
Should contain details such as Version , date compiled, OS Platform compiled on , JDK level used for compile, and any changes
from previous versions
All in all a debug ping message to understand if it is operative without triggering any dangerous mechanisms.

OVERVIEW PACKAGE CLASS TREE DEPRECATED INDEX HELP

PREV CLASS NEXT CLASS FRAMES NO FRAMES ALL CLASSES


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

You might also like