<classpathentry kind="lib" path="lib/servlet-api.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="classes"/>
</classpath>
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
-<html>\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
-<title>Logger</title>\r
-</head>\r
-<body>\r
-<p>詳細な設定なしにロギング用のロガーを簡単に取得する。</p>\r
-<p>\r
-・ファイルに出力します。<br/>\r
-・INFOレベル以上\r
-</p>\r
-</body>\r
-</html>
\ No newline at end of file
* 「メール送信(SendMail)」\r
* 起動オプション:\r
* 第一: メールアカウントの設定ファイル名\r
+ * @param args properties File Name\r
+ * @throws Exception error\r
*/\r
public static void main(String args[]) throws Exception {\r
String fileName = "sendmail.properties";\r
\r
/**\r
* [メニュー]アクション: \r
- * @param event\r
+ * @param event イベント\r
*/\r
public void actionPerformed(ActionEvent event) {\r
Object object = event.getSource();\r
public class Encrypt\r
{\r
/**\r
- * @param args\r
+ * @param args コマンドパラメータ\r
*/\r
public static void main(String[] args) {\r
String source = "deister07";\r
* 指定された文字列を暗号化する。\r
* @param source 暗号化したい文字列\r
* @return 暗号化された文字列\r
- * @throws NoSuchAlgorithmException \r
- * @throws NoSuchPaddingException\r
- * @throws InvalidKeyException \r
- * @throws BadPaddingException \r
- * @throws IllegalBlockSizeException \r
- * @throws InvalidKeySpecException \r
- * @throws InvalidAlgorithmParameterException \r
+ * @throws NoSuchAlgorithmException 例外\r
+ * @throws NoSuchPaddingException 例外\r
+ * @throws InvalidKeyException 例外\r
+ * @throws BadPaddingException 例外\r
+ * @throws IllegalBlockSizeException 例外\r
+ * @throws InvalidKeySpecException 例外\r
+ * @throws InvalidAlgorithmParameterException 例外\r
*/\r
public static String encrypt(String source) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException {\r
//16進数化\r
* 指定されたバイト配列を暗号化する。\r
* @param source 暗号化したいバイト配列\r
* @return 暗号化されたバイト配列\r
- * @throws NoSuchAlgorithmException\r
- * @throws NoSuchPaddingException\r
- * @throws InvalidKeyException\r
- * @throws IllegalBlockSizeException\r
- * @throws BadPaddingException\r
- * @throws InvalidKeySpecException\r
- * @throws InvalidAlgorithmParameterException\r
+ * @throws NoSuchAlgorithmException 例外\r
+ * @throws NoSuchPaddingException 例外\r
+ * @throws InvalidKeyException 例外\r
+ * @throws IllegalBlockSizeException 例外\r
+ * @throws BadPaddingException 例外\r
+ * @throws InvalidKeySpecException 例外\r
+ * @throws InvalidAlgorithmParameterException 例外\r
*/\r
public static byte[] encrypt(byte[] source) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException {\r
PBEParameterSpec pbeParam = new PBEParameterSpec(SALT, NUM);\r
* 復号\r
* @param source 暗号化された文字列\r
* @return 復号された文字列\r
- * @throws NoSuchAlgorithmException \r
- * @throws InvalidKeySpecException \r
- * @throws NoSuchPaddingException \r
- * @throws InvalidAlgorithmParameterException\r
- * @throws InvalidKeyException \r
- * @throws BadPaddingException\r
- * @throws IllegalBlockSizeException \r
+ * @throws NoSuchAlgorithmException 例外\r
+ * @throws InvalidKeySpecException 例外\r
+ * @throws NoSuchPaddingException 例外\r
+ * @throws InvalidAlgorithmParameterException 例外\r
+ * @throws InvalidKeyException 例外\r
+ * @throws BadPaddingException 例外\r
+ * @throws IllegalBlockSizeException 例外\r
*/\r
public static String decode(String source) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException {\r
if (source == null) {\r
* 復号\r
* @param source 暗号化されたバイト配列\r
* @return 復号されたバイト配列\r
- * @throws NoSuchAlgorithmException\r
- * @throws InvalidKeySpecException\r
- * @throws NoSuchPaddingException\r
- * @throws InvalidKeyException\r
- * @throws InvalidAlgorithmParameterException\r
- * @throws IllegalBlockSizeException\r
- * @throws BadPaddingException\r
+ * @throws NoSuchAlgorithmException 例外\r
+ * @throws InvalidKeySpecException 例外\r
+ * @throws NoSuchPaddingException 例外\r
+ * @throws InvalidKeyException 例外\r
+ * @throws InvalidAlgorithmParameterException 例外\r
+ * @throws IllegalBlockSizeException 例外\r
+ * @throws BadPaddingException 例外\r
*/\r
public static byte[] decode(byte[] source) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException {\r
// PBE を新たに生成\r
public class PropertyCheckItem extends hayashi.yuu.tools.properties.PropertyItem {\r
\r
public PropertyCheckItem(hayashi.yuu.tools.properties.Properties prop, String name, String title, boolean value, boolean editable) {\r
- super(prop, name, title, editable);\r
+ super(prop, name, title);\r
field = new JCheckBox(title, Boolean.parseBoolean(prop.getProperty(name, "false")));\r
((JCheckBox)field).addActionListener(this);\r
createItem(name, title, prop.getProperty(name), editable);\r
public class PropertyFieldItem extends PropertyItem implements FocusListener\r
{\r
public PropertyFieldItem(hayashi.yuu.tools.properties.Properties prop, String name, String title, boolean editable) {\r
- super(prop, name, title, editable);\r
+ super(prop, name, title);\r
field = new JTextField(value, 20);\r
((JTextField)field).addFocusListener(this);\r
createItem(name, title, prop.getProperty(name), editable);\r
\r
/**\r
* コンストラクタ\r
- * @param prop\r
- * @param name\r
- * @param editable\r
+ * @param prop プロパティファイル\r
+ * @param name ネーム\r
+ * @param title タイトル\r
*/\r
- public PropertyItem(Properties prop, String name, String title, boolean editable) {\r
+ public PropertyItem(Properties prop, String name, String title) {\r
super(null);\r
logger = LoggerFactory.getInstance();\r
this.propertyName = name;\r
* System.out.println("[反映] "+ label.getText() +" = "+ text.getText());\r
* prop.setProperty(label.getText(), text.getText());\r
* }\r
- * @param e\r
+ * @param e イベント\r
*/\r
public abstract void actionPerformed(ActionEvent e);\r
}\r
public class PropertyPasswordItem extends PropertyItem implements FocusListener\r
{\r
public PropertyPasswordItem(hayashi.yuu.tools.properties.Properties prop, String name, String title, boolean editable) {\r
- super(prop, name, title, editable);\r
+ super(prop, name, title);\r
field = new JPasswordField(value, 20);\r
((JPasswordField)field).addFocusListener(this);\r
createItem(name, title, prop.getProperty(name), editable);\r
public class PropertySelectItem extends PropertyItem {\r
\r
public PropertySelectItem(hayashi.yuu.tools.properties.Properties prop, String name, String title, boolean editable, String[] items) {\r
- super(prop, name, title, editable);\r
+ super(prop, name, title);\r
field = new JComboBox();\r
((JComboBox)field).addActionListener(this);\r
for (int i=0; i < items.length; i++) {\r
* (2) playSound.start();
* サウンド再生を実行。
*
- * @param args
+ * @param args args
*/
public static void main(String[] args) {
/*
/**
* コンストラクタ
- * @throws IOException
- * @throws UnsupportedAudioFileException
- * @throws LineUnavailableException
+ * @param path パス
+ * @throws IOException 例外
+ * @throws UnsupportedAudioFileException 例外
+ * @throws LineUnavailableException 例外
*/
public PlaySound(String path) throws IOException, UnsupportedAudioFileException, LineUnavailableException {
super();
* 標準出力とエラー出力の結果を合成してかえす。\r
* よって、本メソッドを実行するとgetStdout(),getErrout()は無効になる\r
* このメソッドは、execCommand()メソッドを実行した直後の1回目の実行結果のみ有効\r
+ * @return result\r
+ * @throws IOException 例外\r
*/\r
public String getOutput() throws IOException {\r
String std = getStdout();\r
/**\r
* コマンド実行結果の標準出力\r
* このメソッドは、execCommand()メソッドを実行した直後の1回目の実行結果のみ有効\r
+ * @throws IOException 例外\r
+ * @return 結果\r
*/\r
public String getStdout() throws IOException {\r
return convBufferedReader(this.stdReader);\r
/**\r
* コマンド実行結果のエラー出力\r
* このメソッドは、execCommand()メソッドを実行した直後の1回目の実行結果のみ有効\r
+ * @throws IOException 例外\r
+ * @return 結果\r
*/\r
public String getErrout() throws IOException {\r
return convBufferedReader(this.errReader);\r
\r
/** \r
* サンプル\r
+ * @param args パラメータ\r
*/\r
static public void main(String[] args) {\r
if (args.length < 1) {\r
/** \r
* サンプル\r
* exp: java jp.co.areaweb.tools.command.JSendmail [parameter]\r
+ * @param args parameters\r
+ * @throws Exception 例外\r
*/\r
static public void main(String[] args) throws Exception {\r
String commandLine = "";\r
\r
/** \r
* サンプル\r
+ * @param args parameters\r
*/\r
static public void main(String[] args) {\r
if (args.length < 1) {\r
{\r
/** \r
* Jobファイルに記述されたXSLT処理を順次実行する。\r
+ * @param jobgroupNodes node\r
+ * @throws Exception error\r
*/\r
protected static void execJobElement(NodeList jobgroupNodes) throws Exception {\r
execJobElement(jobgroupNodes, null);\r
\r
/**\r
* xmlファイルをxslファイルで処理した結果をoutputファイルに出力する。\r
+ * @param xmlStr string\r
+ * @param xslStr string\r
+ * @param outputStr string\r
+ * @throws Exception error\r
*/\r
protected static void execXslt(String xmlStr, String xslStr, String outputStr) throws Exception {\r
System.out.println("XALAN("+ xmlStr +" * "+ xslStr +") -> "+ outputStr);\r
/**\r
* Jobファイルに記述されたコマンドを順次実行する。\r
* @param jobFile Jobコマンドが記述されたファイル\r
- * @throws IOException JOBファイルの読み込み障害\r
+ * @throws Exception JOBファイルの読み込み障害\r
*/\r
public static void execJob(File jobFile) throws Exception {\r
execJob(jobFile, null);\r
* Jobファイルに記述されたコマンドを順次実行する。\r
* @param jobFile Jobコマンドが記述されたファイル\r
* @param workDir コマンドを実行するさいのカレントディレクトリ\r
- * @throws IOException JOBファイルの読み込み障害\r
+ * @throws Exception JOBファイルの読み込み障害\r
*/\r
public static void execJob(File jobFile, File workDir) throws Exception {\r
if (jobFile == null) {\r
* Jobファイルに記述されたコマンドを順次実行する。\r
* @param jobFile Jobコマンドが記述されたファイル\r
* @param workDir コマンドを実行するさいのカレントディレクトリ\r
- * @throws IOException JOBファイルの読み込み障害\r
+ * @param jobgroupNodes NodeList\r
+ * @throws Exception JOBファイルの読み込み障害\r
*/\r
protected static void execJobElement(File jobFile, File workDir, NodeList jobgroupNodes)\r
throws Exception {\r
\r
/**\r
* Vector commandsに格納されたコマンドを順次実行する。\r
+ * @param stdout string\r
+ * @param errout string\r
+ * @param commands Vector\r
* @throws IOException JOBファイルの読み込み障害\r
*/\r
protected static void execJobs(String stdout, String errout, Vector<Command> commands) throws IOException {\r
\r
/** \r
* サンプル\r
+ * @param args strings\r
+ * @throws Exception error\r
*/\r
static public void main(String[] args) throws Exception {\r
if (args.length < 1) {\r
* -Xmx最大ヒープサイズ\r
* Java仮想マシンへの最大メモリ割り当て量を指定します。デフォルトは64MBです。\r
* \r
- * @param args\r
+ * @param args strings\r
*/\r
public static void main(String[] args) {\r
System.out.println(getMemoryInfo());\r
public abstract class Tax {\r
public static int taxRates = 5; // 消費税率。パーセンテージで示す。\r
// 税率が変更されたときにはこの値を直接変更する。\r
- \r
/**\r
* 総額に対する本体の金額を求める。\r
+ * @param totalValue long\r
+ * @return 結果\r
*/\r
public static long calcBody(long totalValue) {\r
return Math.round((new Long(totalValue)).doubleValue() * 100 / (100 + taxRates));\r
\r
/**\r
* 総額に対する消費税額を求める。\r
+ * @param totalValue long\r
+ * @return 結果\r
*/\r
public static long calcTax(long totalValue) {\r
return totalValue - calcBody(totalValue) ;\r
\r
/**\r
* 本体価格に対する消費税額を求める。\r
+ * @param bodyValue long\r
+ * @return 結果\r
*/\r
public static long toTax(long bodyValue) {\r
return Math.round((new Long(bodyValue)).doubleValue() * taxRates / 100);\r
\r
/**\r
* 本体価格に対する総額を求める。\r
+ * @param bodyValue long\r
+ * @return 結果\r
*/\r
public static long toTotal(long bodyValue) {\r
return bodyValue + toTax(bodyValue);\r
\r
/**\r
* CVSファイルからデータを読みだします。\r
+ * @throws Exception 例外\r
*/\r
public void load() throws Exception {\r
this.load(0);\r
/**\r
* CVSファイルからデータを読みだします。\r
* (読み出し数の制限付き)\r
+ * @param limit 読み出し数の制限\r
+ * @throws Exception 例外\r
*/\r
public void load(int limit) throws Exception {\r
this.clear();\r
\r
/**\r
* 元ファイルを設定する。\r
+ * @param file File\r
*/\r
public void setFile(File file) {\r
this.file = file;\r
\r
/**\r
* データ内容をファイルに書き戻す。<br>\r
+ * @param outputFile 出力ファイル\r
* @throws IOException ファイルへの書き出しに失敗した。\r
*/\r
public void save(File outputFile) throws IOException {\r
* CSVファイルの読み取りを行う。\r
* (読み出し可能ファイルサイズ=最大8MBまで)\r
* \r
- * @param args\r
+ * @param args パラメータ\r
+ * @throws Exception error\r
*/\r
public static void main(String[] args) throws Exception {\r
File file = new File("test.csv");\r
* fileで指定されたファイルを対象のCSVファイルとします.\r
* \r
* @param file 対象のCSVファイル\r
- * @throws IOException \r
- * @throws UnsupportedEncodingException \r
+ * @throws IOException 例外\r
+ * @throws UnsupportedEncodingException 例外\r
*/\r
public CsvReader(File file) throws UnsupportedEncodingException, IOException {\r
this(file, false, ",");\r
* fileで指定されたファイルを対象のCSVファイルとします.\r
* \r
* @param file 対象のCSVファイル\r
- * @throws IOException \r
- * @throws UnsupportedEncodingException \r
+ * @param titleLine boolean\r
+ * @param split string\r
+ * @throws IOException 例外\r
+ * @throws UnsupportedEncodingException 例外\r
*/\r
public CsvReader(File file, boolean titleLine, String split) throws UnsupportedEncodingException, IOException {\r
this.file = file;\r
/**\r
* CVSファイルからデータを読みだします。\r
* (読み出し可能ファイルサイズ=最大8MBまで)\r
+ * @throws Exception 例外\r
+ * @return 読み出しサイズ\r
*/\r
public int load() throws Exception {\r
this.reader = new LineNumberReader(new InputStreamReader(new FileInputStream(this.file), this.charsetName));\r
* @param index 検索対象とする列番号(0~)\r
* @param dataStr 検索値\r
* @return 条件に合致したレコード(複数)\r
- * @throws IOException \r
+ * @throws IOException 例外\r
*/\r
public LinkedList<CsvRecord> find(int index, String dataStr) throws IOException {\r
if ((index < 0) || (index > this.size)) {\r
/**\r
* 設定ファイルに従って、データベースコネクションをオープンしてコネクションを得る。\r
* 指定のデータベースが存在しないときは新に作成する。\r
+ * @param propertiesFileName プロパティファイル\r
* @throws ClassNotFoundException 指定のデータベースドライバが見つからなかった\r
* @throws SQLException データベース障害\r
+ * @throws FileNotFoundException error\r
+ * @throws IOException error\r
* @return データベースコネクション\r
*/ \r
public static Connection openDb(String propertiesFileName) throws ClassNotFoundException,SQLException,FileNotFoundException,IOException {\r
* 指定のデータベースが存在しないときは新に作成する。\r
* @throws ClassNotFoundException 指定のデータベースドライバが見つからなかった\r
* @throws SQLException データベース障害\r
+ * @throws FileNotFoundException error\r
+ * @throws IOException error\r
* @return データベースコネクション\r
*/ \r
public static Connection openDb() throws ClassNotFoundException,SQLException,FileNotFoundException,IOException {\r
* sqlfileの中のSQL文を1行づつ実行する。\r
* ・SELECT文は実行できない。\r
* ・一つのSQL文は1行で記述すること。(途中改行はだめ)\r
+ * @param propertieFile プロパティファイル\r
* @param sqlfile SQL文が記述されたファイル。\r
*/\r
public static void doSQL(String propertieFile, String sqlfile) {\r
* sqlfileの中のSQL文を1行づつ実行する。\r
* ・SELECT文は実行できない。\r
* ・一つのSQL文は1行で記述すること。(途中改行はだめ)\r
+ * @param propertieFile プロパティファイル\r
* @param sqlfile SQL文が記述されたファイル。\r
*/\r
public static void doSQL(String propertieFile, String sqlfile) {\r
}\r
\r
/**\r
- * @param args\r
+ * @param args parameter\r
*/\r
public static void main(String[] args) {\r
// TODO Auto-generated method stub\r
/**\r
* このクラスをインスタンスを生成して表示する。\r
* コマンドラインの引数はありません。\r
+ * @param args parameter\r
*/ \r
static public void main(String args[]) {\r
(new Manager()).setVisible(true);\r
* <!ELEMENT change (hiduke,user)>\r
* <!ELEMENT hiduke (#PCDATA)>\r
* <!ELEMENT user (#PCDATA)><!ATTLIST user id CDATA #IMPLIED>\r
+ * @param document Document\r
+ * @param elementName string\r
+ * @param hiduke 日付\r
+ * @param userid int\r
+ * @return Element\r
*/\r
public static Element setEntryElement(Document document, String elementName, java.util.Date hiduke, int userid) {\r
return setEntryElement(document, elementName, exchengeDate2TimeInstant(hiduke), userid, "user");\r
* @version 00-00\r
*/\r
public class YuuMailXml extends SendMail {\r
- /** Creates new YuuMail */\r
+ /** \r
+ * Creates new YuuMail \r
+ * @param siteData DATA\r
+ */\r
public YuuMailXml(SiteData siteData) {\r
super(siteData);\r
}\r
\r
/**\r
* "jp.co.areaweb.tools.common.YuuMailXml <property.xml> <sendMail.xml>"\r
+ * @param args parameter\r
*/\r
public static void main(java.lang.String[] args) {\r
String inputfile;\r
--- /dev/null
+package hayashi.tools.files;
+
+import java.io.File;
+
+import org.junit.Test;
+
+import junit.framework.TestCase;
+
+public class DeleteDirTest extends TestCase {
+
+ @Test(expected = Exception.class)
+ public void 指定したファイルがないとき() throws Exception {
+ DeleteDir.listup(new File("testspace", "FOLDER"));
+ }
+}
* 文字列のトリミングを行う.通常のjava.lang.String.trim()の機能に加えて、\r
* 全角スペースもトリム対象の文字に加える。\r
*/\r
-public class TestJapaneseString extends TestCase {\r
+public class JapaneseStringTest extends TestCase {\r
\r
/**\r
* テスト\r
* @param keta\r
* @return\r
*/\r
-public class TestMakeString extends TestCase {\r
+public class MakeStringTest extends TestCase {\r
\r
/**\r
* テスト1\r
*/\r
package jp.co.areaweb.tools.core;\r
\r
-import jp.co.areaweb.tools.core.Tax;\r
import junit.framework.TestCase;\r
\r
/**\r
* @author y_hayashi\r
*\r
*/\r
-public class TestTax extends TestCase {\r
+public class TaxTest extends TestCase {\r
\r
/**\r
* テスト1\r
--- /dev/null
+テスト用のワーク領域\r