{"id":628,"date":"2013-02-27T16:49:58","date_gmt":"2013-02-27T07:49:58","guid":{"rendered":"http:\/\/systemdev.comsys-blog.com\/?p=628"},"modified":"2013-02-27T16:49:58","modified_gmt":"2013-02-27T07:49:58","slug":"java-%e3%81%a7%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e5%90%8d%e3%82%92%e5%88%86%e8%a7%a3%e3%81%99%e3%82%8b%e3%82%af%e3%83%a9%e3%82%b9","status":"publish","type":"post","link":"https:\/\/tamura.jp\/?p=628","title":{"rendered":"JAVA \u3067\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5206\u89e3\u3059\u308b\u30af\u30e9\u30b9"},"content":{"rendered":"<p>JAVA \u3067\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5206\u89e3\u3059\u308b\u30af\u30e9\u30b9<br \/>\n[text]<br \/>\npackage jp.computer-system.util.file;<\/p>\n<p>public class FileString<br \/>\n{<br \/>\n\tprivate String filePath = &#8220;&#8221;;<br \/>\n\tprivate String drive;<br \/>\n\tprivate String folder;<br \/>\n\tprivate String fileName;<br \/>\n\tprivate String ext;<\/p>\n<p>\tpublic FileString()<br \/>\n\t{<br \/>\n\t}<\/p>\n<p>\tpublic FileString(String filePath)<br \/>\n\t{<br \/>\n\t\tthis.filePath = filePath;<br \/>\n\t\tString[] strs = filePath.split(&#8220;[\/,\\\\\\\\]&#8221;);<br \/>\n\t\tif(strs.length == 0 ) return;<br \/>\n\t\tint six = 0;<br \/>\n\t\tif(!(strs[0].indexOf(&#8220;:&#8221;)==-1))<br \/>\n\t\t{<br \/>\n\t\t\tsix=1;<br \/>\n\t\t\tdrive = strs[0];<br \/>\n\t\t}<br \/>\n\t\tfolder = &#8220;&#8221;;<br \/>\n\t\tfor(int i=six;i&lt;(strs.length &#8211; 1);i++)<br \/>\n\t\t{<br \/>\n\t\t\tif(folder.length()!=0)<br \/>\n\t\t\t{<br \/>\n\t\t\t\tfolder += &quot;\/&quot; + strs[i];<br \/>\n\t\t\t}<br \/>\n\t\t\telse<br \/>\n\t\t\t{<br \/>\n\t\t\t\tfolder = strs[i];<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t\tfileName = strs[strs.length -1];<br \/>\n\t\tint ip = fileName.lastIndexOf(&quot;.&quot;);<br \/>\n\t\tif(ip==-1)<br \/>\n\t\t{<br \/>\n\t\t\text = &quot;&quot;;<br \/>\n\t\t}<br \/>\n\t\telse<br \/>\n\t\t{<br \/>\n\t\t\tif((ip+1)==fileName.length())<br \/>\n\t\t\t{<br \/>\n\t\t\t\text = &quot;&quot;;<br \/>\n\t\t\t}<br \/>\n\t\t\telse<br \/>\n\t\t\t{<br \/>\n\t\t\t\text = fileName.substring(ip + 1);<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\tpublic String getDrive() {<br \/>\n\t\treturn drive;<br \/>\n\t}<br \/>\n\tpublic void setDrive(String drive) {<br \/>\n\t\tthis.drive = drive;<br \/>\n\t}<br \/>\n\tpublic String getFolder() {<br \/>\n\t\treturn folder;<br \/>\n\t}<br \/>\n\tpublic void setFolder(String folder) {<br \/>\n\t\tthis.folder = folder;<br \/>\n\t}<br \/>\n\tpublic String getFileName() {<br \/>\n\t\treturn fileName;<br \/>\n\t}<br \/>\n\tpublic void setFileName(String fileName) {<br \/>\n\t\tthis.fileName = fileName;<br \/>\n\t}<br \/>\n\tpublic String getExt() {<br \/>\n\t\treturn ext;<br \/>\n\t}<br \/>\n\tpublic void setExt(String ext) {<br \/>\n\t\tthis.ext = ext;<br \/>\n\t}<\/p>\n<p>\tpublic String getFilePath() {<br \/>\n\t\treturn filePath;<br \/>\n\t}<br \/>\n\tpublic void setFilePath(String filePath) {<br \/>\n\t\tthis.filePath = filePath;<br \/>\n\t}<br \/>\n}<\/p>\n<p>[\/text]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JAVA \u3067\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5206\u89e3\u3059\u308b\u30af\u30e9\u30b9 [text] package jp.computer-system.util.file; public class FileString { private String file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-628","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts\/628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=628"}],"version-history":[{"count":0,"href":"https:\/\/tamura.jp\/index.php?rest_route=\/wp\/v2\/posts\/628\/revisions"}],"wp:attachment":[{"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tamura.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}