|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.fiverworks.xone.ut.TextUt
テキスト関連のユーティリティクラスです。
メソッドの概要 | |
static String |
getFileExtension(File file)
指定されたファイルのピリオドを除いた拡張子部分だけを返します。 |
static String |
getFileNameWithExtention(String fileName,
String ext)
指定されたファイル名と拡張子を連結して返します。 |
static String |
getMD5String(char[] chs)
指定された文字配列をMD5で暗号化した文字列を返します。 |
static String |
getMD5String(String str)
指定された文字列をMD5で暗号化した文字列を返します。 |
static String |
pack(byte[] target)
指定されたバイト配列をGZIPで圧縮し、Base64でエンコードした文字列を返します。 |
static String |
pack(String target)
指定された文字列をGZIPで圧縮し、Base64でエンコードした文字列を返します。 |
static String |
replace(String target,
String preword,
String postword)
targetの中のprewordをpostwordに置き換えた文字列を返します。 |
static String[] |
split(String target,
String separator)
targetをseparatorで分割した文字列配列を返します。 |
static String[] |
split(String target,
String separator,
int limit)
targetをseparatorでlimit個まで分割した文字列配列を返します。 |
static byte[] |
unpackToByteArray(String packedString)
指定された文字列をBase64でデコードし、GZIPで解凍したバイト配列を返します。 |
static String |
unpackToString(String packedString)
指定された文MatchUt字列をBase64でデコードし、GZIPで解凍した文字列を返します。 |
static String |
xreplace(String target,
String preword,
String postword,
String delimiter)
targetの中のprewordをpostwordに置き換えた文字列を返します。 |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
メソッドの詳細 |
public static String getMD5String(String str)
str
- 文字列
XoneRuntimeException
- strがnullまたは空文字の場合public static String getMD5String(char[] chs)
chs
- 文字配列
XoneRuntimeException
- chsがnullまたは長さが0の場合public static String replace(String target, String preword, String postword)
target
- 対象の文字列preword
- 置換される文字列postword
- 置換する文字列
public static String xreplace(String target, String preword, String postword, String delimiter)
xreplace("abc.abc/abc-abc/abc", "abc", "xyz",
"./")
の結果は"xyz.xyz/abc-abc/xyz"となります。
target
- 対象の文字列preword
- 置換される文字列postword
- 置換する文字列delimiter
- 区切り文字
public static String[] split(String target, String separator)
java.lang.Stringのsplitメソッド
と異なり、返値に空文字は含まれません。
例:
target
- 対象の文字列separator
- 分割する文字列(正規表現)
public static String[] split(String target, String separator, int limit)
java.lang.Stringのsplitメソッド
と異なり、返値に空文字は含まれません。
limit
- 分割の最大値target
- 対象の文字列separator
- 分割する文字列(正規表現)
public static String pack(String target)
target
- 文字列
XoneRuntimeException
- 実行エラーが発生した場合public static String pack(byte[] target)
target
- バイト配列
XoneRuntimeException
- 実行エラーが発生した場合public static String unpackToString(String packedString)
pack(String target)
の逆です。
packedString
- バイト配列
XoneRuntimeException
- 実行エラーが発生した場合public static byte[] unpackToByteArray(String packedString)
pack(byte[] target)
の逆です。
packedString
- バイト配列
XoneRuntimeException
- 実行エラーが発生した場合public static String getFileExtension(File file)
file
- ファイル
public static String getFileNameWithExtention(String fileName, String ext)
fileName
- ファイル名ext
- 拡張子
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |