構成
Apache Commons BeanUtil
Apache Commons CSV
Apache Commons Daemon
Apache Commons IO
Apache Commons Lang
Apache Commons Logging
Apache Commons Net
Apache Commons BeanUtil
org.apache.commons.beanutils.BeanUtilsクラスのcopyPropertiesメソッドで、Beansから他のBeansへ全てのプロパティをコピーできる。
// nullをjava.sql.Timestampのプロパティへコピーするための設定
ConvertUtils.register(new SqlTimestampConverter(null), java.sql.Timestamp.class);// プロパティのコピー
BeanUtils.copyProperties(dest, orig);// SqlTimestampConverterの解除
ConvertUtils.deragister();
Apache Commons IO
クラスorg.apache.commons.io.FileUtils
org.apache.commons.io.IOUtils
org.apache.commons.io.output.ByteArrayOutputStream
org.apache.commons.io.FileUtils
copyFile
ファイルをコピーする。
static void copyFile(File srcFile, File destFile)
org.apache.commons.io.output.ByteArrayOutputStream
ByteArrayOutputStreamは、データがバイト配列に書き込まれる出力ストリームである。
コンストラクタ
新しいバイト配列出力ストリームを作成する。
ByteArrayOutputStreamByteArrayOutputStream(int size)
org.apache.commons.lang3.StringUtilsクラス
isEmpty
static boolean isEmpty(java.lang.String)
isNotEmpty
static boolean isNotEmpty(java.lang.String)
Apache Commons Logging
org.apache.commons.logging.LogFactoryクラス
org.apache.commons.logging.LogFactoryクラスのメソッド戻り値の型メソッド説明static LoggetLog(Object clazz )指定したオブジェクトのロガーを返す。static LoggetLog(String name )指定した名称のロガーを返す。
debug
debugレベルのログを出力する。
void debug(Object message)
debugレベルのログを出力する例を示す。
Logger logger = Logger.getLogger(MyApp.class);
logger.debug("Hello world!");
isDebugEnabled
debugレベルのログを出力するかどうかを返す。
boolean isDebugEnabled()
debugレベルのログを出力する例を示す。
if (log.isDebugEnabled()) {
log.debug("名前=" + name);
}