|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.rdg.resc.jstyx.StyxUtils
public class StyxUtils
Set of constants and useful static methods for the Styx protocol
| Field Summary | |
|---|---|
static java.lang.String |
ANONYMOUS_USER
The username for an anonymous user |
static java.lang.String |
DEFAULT_GROUP
When a client creates a file on the Styx server, this is the default group for the file. |
static long |
DMAPPEND
|
static long |
DMAUTH
|
static long |
DMDIR
|
static long |
DMEXCL
|
static int |
HEADER_LENGTH
The header length of a StyxMessage |
static int |
MAX_MESSAGE_SIZE
The maximum length of a single Styx message. |
static int |
MAXPATHELEMENTS
|
static int |
MAXUBYTE
|
static long |
MAXUINT
|
static long |
MAXULONG
|
static int |
MAXUSHORT
|
static java.lang.String |
NEWLINE
|
static long |
NOFID
|
static int |
NOTAG
|
static int |
OEXEC
|
static int |
ORCLOSE
|
static int |
ORDWR
|
static int |
OREAD
|
static int |
OTRUNC
|
static int |
OWRITE
|
static java.lang.String |
SYSTEM_FILE_SEPARATOR
|
static java.lang.String |
SYSTEM_NEWLINE
|
static java.nio.charset.Charset |
UTF8
|
| Constructor Summary | |
|---|---|
StyxUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
dataToString(org.apache.mina.common.ByteBuffer buf)
Gets the remaining contents of the given ByteBuffer (i.e. |
static java.lang.String |
dataToString(java.nio.ByteBuffer buf)
Gets the remaining contents of the given java.nio.ByteBuffer (i.e. |
static java.lang.String |
formatAsXsdDateTime(java.util.Date date)
Returns a date formatted according to the xsd:dateTime data type |
static java.lang.String |
getDataSummary(int n,
byte[] bytes)
|
static java.lang.String |
getDataSummary(int n,
org.apache.mina.common.ByteBuffer data)
|
static void |
main(java.lang.String[] args)
Simple test routine for the date parsing routines |
static long |
now()
|
static java.util.Date |
parseXsdDateTime(java.lang.String date)
Parses a String that is formatted according to the xsd:dateTime data type and returns it as a Date |
static byte[] |
strToUTF8(java.lang.String str)
Converts a string to a byte array in UTF-8 |
static java.lang.String |
utf8ToString(byte[] bytes)
Converts an array of bytes in UTF-8 to a String |
static java.lang.String |
utf8ToString(byte[] bytes,
int offset,
int length)
Converts an array of bytes in UTF-8 to a String |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HEADER_LENGTH
public static final int MAX_MESSAGE_SIZE
public static final int MAXUBYTE
public static final int MAXUSHORT
public static final long MAXUINT
public static final long MAXULONG
public static final int NOTAG
public static final long NOFID
public static final int MAXPATHELEMENTS
public static final int OREAD
public static final int OWRITE
public static final int ORDWR
public static final int OEXEC
public static final int OTRUNC
public static final int ORCLOSE
public static final long DMDIR
public static final long DMAPPEND
public static final long DMEXCL
public static final long DMAUTH
public static final java.nio.charset.Charset UTF8
public static final java.lang.String NEWLINE
public static final java.lang.String SYSTEM_NEWLINE
public static final java.lang.String SYSTEM_FILE_SEPARATOR
public static final java.lang.String ANONYMOUS_USER
public static final java.lang.String DEFAULT_GROUP
| Constructor Detail |
|---|
public StyxUtils()
| Method Detail |
|---|
public static byte[] strToUTF8(java.lang.String str)
public static java.lang.String utf8ToString(byte[] bytes)
public static java.lang.String utf8ToString(byte[] bytes,
int offset,
int length)
bytes - The array of bytes to convertoffset - The index of the first byte in the array to convertlength - The number of bytes to convertpublic static java.lang.String dataToString(org.apache.mina.common.ByteBuffer buf)
public static java.lang.String dataToString(java.nio.ByteBuffer buf)
public static java.lang.String getDataSummary(int n,
org.apache.mina.common.ByteBuffer data)
public static java.lang.String getDataSummary(int n,
byte[] bytes)
public static long now()
public static java.lang.String formatAsXsdDateTime(java.util.Date date)
date - the date to format.
public static java.util.Date parseXsdDateTime(java.lang.String date)
throws java.text.ParseException
date - the String to format.
java.text.ParseException
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||