{"id":20626,"date":"2017-03-31T23:23:21","date_gmt":"2017-03-31T14:23:21","guid":{"rendered":"http:\/\/www.sejuku.net\/blog\/?p=20626"},"modified":"2024-05-06T11:41:13","modified_gmt":"2024-05-06T02:41:13","slug":"%e3%80%90java%e5%85%a5%e9%96%80%e3%80%91file%e3%81%ae%e3%81%95%e3%81%be%e3%81%96%e3%81%be%e3%81%aa%e5%89%8a%e9%99%a4%e6%96%b9%e6%b3%95%e3%81%be%e3%81%a8%e3%82%81","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/20626","title":{"rendered":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u30d5\u30ea\u30fc\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30e4\u30de\u30b7\u30bf\u3067\u3059\u3002<\/p>\n<p>Java\u3067\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306b\u4f7f\u7528\u3059\u308b<span style=\"color: #339966;\"><strong>File<\/strong><\/span>\u30af\u30e9\u30b9\u306f\u3055\u307e\u3056\u307e\u306a\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u3067\u5fc5\u8981\u306a\u3001<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong><\/span><br \/>\n<span style=\"color: #ff0000;\"><strong>\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong><\/span><\/p>\n<p>\u3068\u3044\u3046\u57fa\u672c\u7684\u306a\u5185\u5bb9\u304b\u3089\u3001<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30fb\u524a\u9664\u3067\u304d\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u5f37\u5236\u7684\u306b\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong><\/span><br \/>\n<span style=\"color: #ff0000;\"><strong>\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u3066\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong><\/span><br \/>\n<span style=\"color: #ff0000;\"><strong>\u30fb\u62e1\u5f35\u5b50\u3092\u6307\u5b9a\u3057\u3066\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong><\/span><\/p>\n<p>\u306a\u3069\u306e\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u306b\u95a2\u3057\u3066\u3082\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u305d\u3093\u306a\u60a9\u307f\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\uff01<\/p>\n<p>\u306a\u304a\u3001Java\u306e\u8a18\u4e8b\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/www.sejuku.net\/blog\/148098\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>delete\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/h2>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u306b\u306f\u3001File\u30af\u30e9\u30b9\u306e<span style=\"color: #339966;\"><strong>delete<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>delete\u30e1\u30bd\u30c3\u30c9\u306fboolean\u578b\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">public boolean delete()<\/pre>\n<p>\u4ee5\u4e0b\u306bdelete\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u65b9\u6cd5\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:java decode:true \">import java.io.File;\r\n\r\npublic class FileClass {\r\n\r\n    public static void main(String[] args) {\r\n        File file = new File(\"\/Users\/Shared\/java\/java.txt\");\r\n \r\n        \/\/delete\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\r\n        file.delete();\r\n    }\r\n\r\n}<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001<span style=\"color: #339966;\"><strong>File<\/strong><\/span>\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5f15\u6570\u306b<span style=\"color: #0000ff;\"><strong>\u7d76\u5bfe\u30d1\u30b9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a<\/strong><\/span>\u3057\u3001<span style=\"color: #339966;\"><strong>delete<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3067<span style=\"color: #0000ff;\"><strong>\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664<\/strong><\/span>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u57fa\u672c\u7684\u306a\u524a\u9664\u65b9\u6cd5\u3084\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u3082\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\uff01<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/20626\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<h2>\u524a\u9664\u3067\u304d\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u5f37\u5236\u7684\u306b\u524a\u9664\u3059\u308b\u306b\u306f<\/h2>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308bdelete\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3082\u3001<span style=\"color: #ff0000;\"><strong>\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u306b\u5931\u6557<\/strong><\/span>\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>delete\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u524a\u9664\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u3084\u3001\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u53ca\u3073\u3001\u524a\u9664\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30e6\u30fc\u30b6\u30fc\u304c\u958b\u3044\u3066\u3044\u305f\u5834\u5408\u306a\u3069\u3082\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u304c\u5931\u6557\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001Java\u306b\u306f<span style=\"color: #ff0000;\"><strong>\u30d5\u30a1\u30a4\u30eb\u3092\u5f37\u5236\u7684\u306b\u524a\u9664\u3059\u308b\u65b9\u6cd5\u306f\u3042\u308a\u307e\u305b\u3093<\/strong><\/span>\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u524a\u9664\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<span style=\"color: #0000ff;\"><strong>\u6307\u5b9a\u3057\u305f\u56de\u6570\u5206\u30eb\u30fc\u30d7\u3067\u30ea\u30c8\u30e9\u30a4<\/strong><\/span>\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:java decode:true \">import java.io.File;\r\nimport java.lang.Thread;\r\n\r\npublic class FileClass {\r\n\r\n    public static void main(String[] args) {\r\n        File file = new File(\"\/Users\/Shared\/java\/java.txt\");\r\n        \r\n        \/\/\u30d5\u30a1\u30a4\u30eb\u304c\u524a\u9664\u3055\u308c\u308b\u307e\u3067\u6307\u5b9a\u56de\u6570\u5206\u30eb\u30fc\u30d7\u3059\u308b\r\n        for(int i=0; i&lt;100; i++) {\r\n            if(file.delete()) {\r\n                System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u9664\u6210\u529f\");\r\n                break;\r\n            } else {\r\n                System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u9664\u5931\u6557\");\r\n                \/\/\u5931\u6557\u3057\u305f\u3089\u30011\u79d2\u3054\u3068\u306b\u30b9\u30ea\u30fc\u30d7\u3057\u3066\u30ea\u30c8\u30e9\u30a4\u3059\u308b\r\n                try {\r\n                    Thread.sleep(1000);\r\n                } catch(InterruptedException e) {\r\n                    e.printStackTrace();\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n}<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001\u30ea\u30c8\u30e9\u30a4\u56de\u6570\u3092100\u3067\u8a2d\u5b9a\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u306b\u5931\u6557\u3057\u305f\u3089\u3001<span style=\"color: #339966;\"><strong>sleep<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u30661\u79d2\u30b9\u30ea\u30fc\u30d7\u5f8c\u306b\u3001<span style=\"color: #0000ff;\"><strong>\u518d\u3073\u30d5\u30a1\u30a4\u30eb\u524a\u9664\u3092\u5b9f\u884c<\/strong><\/span>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b<\/h2>\n<p>File\u30af\u30e9\u30b9\u306edelete\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u57fa\u672c\u7684\u306b<span style=\"color: #ff0000;\"><strong>1\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3057\u304b\u524a\u9664\u3067\u304d\u307e\u305b\u3093<\/strong><\/span>\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u307e\u3068\u3081\u3066\u524a\u9664\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306b\u3001\u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u3001<span style=\"color: #0000ff;\"><strong>\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u307e\u3068\u3081\u3066\u524a\u9664<\/strong><\/span>\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:java decode:true \">import java.io.File;\r\n\r\n\/\/ \u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\r\nclass FileClass {\r\n \r\n    public static void fileClass(File dir) {        \r\n        \/\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\r\n        if(dir.exists()) {\r\n            \r\n            if(dir.isFile()) {\r\n                if(dir.delete()) {\r\n                    System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u9664\");\r\n                }\r\n            } else if(dir.isDirectory()) {\r\n                File[] files = dir.listFiles();\r\n                \r\n                if(files == null) {\r\n                    System.out.println(\"\u914d\u4e0b\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\");\r\n                }\r\n                \/\/for\u6587\u3067\u30d5\u30a1\u30a4\u30eb\u30ea\u30b9\u30c8\u5206\u30eb\u30fc\u30d7\u3059\u308b\r\n                for(int i=0; i&lt;files.length; i++) {\r\n                    \r\n                    \/\/\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u78ba\u8a8d\r\n                    if(files[i].exists() == false) {\r\n                        continue;\r\n                    \/\/\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u5408\u306f\u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u524a\u9664\u3059\u308b\r\n                    } else if(files[i].isFile()) {\r\n                        fileClass(files[i]);\r\n                        System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u96642\");\r\n                    }        \r\n                }\r\n            }\r\n        } else {\r\n            System.out.println(\"\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3057\u306a\u3044\");\r\n        }\r\n    }\r\n}\r\n\r\npublic class FileDelete {\r\n \r\n    public static void main(String[] args) {\r\n        FileClass fc = new FileClass();\r\n        File dir = new File(\"\/Users\/Shared\/java\/\");\r\n        FileClass.fileClass(dir);\r\n    }\r\n\r\n}<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001main\u30e1\u30bd\u30c3\u30c9\u3067\u3001File\u30af\u30e9\u30b9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bfileClass\u3067\u5f15\u6570\u306b\u6e21\u3055\u308c\u305fFile\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u5b9a\u3057\u3066\u3001\u524a\u9664\u51e6\u7406\u3092\u5b9f\u65bd\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u914d\u4e0b\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u5834\u5408\u306f\u3001<span style=\"color: #339966;\"><strong>listFiles<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3067<span style=\"color: #0000ff;\"><strong>\u53d6\u5f97\u3057\u305f\u30ea\u30b9\u30c8<\/strong><\/span>\u5206\u30eb\u30fc\u30d7\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u5408\u306f\u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u62e1\u5f35\u5b50\u3092\u6307\u5b9a\u3057\u3066\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/h2>\n<p>java\u3067\u306f\u57fa\u672c\u7684\u306b\u524a\u9664\u51e6\u7406\u3067<span style=\"color: #ff0000;\"><strong>\u6b63\u898f\u8868\u73fe\u3084\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u306e\u524a\u9664\u306f\u3067\u304d\u307e\u305b\u3093<\/strong><\/span>\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001<span style=\"color: #0000ff;\"><strong>\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3084\u62e1\u5f35\u5b50\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u524a\u9664<\/strong><\/span>\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306b\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u304c\u201d*.java\u201d\u306e\u5834\u5408\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:java decode:true \">import java.io.File;\r\n\r\n\/\/ \u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\r\nclass FileClass {\r\n \r\n    public static void fileClass(File dir) {        \r\n        if(dir.exists()) {\r\n            \r\n            if(dir.isFile()) {\r\n                if(dir.delete()) {\r\n                    System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u9664\");\r\n                }\r\n            } else if(dir.isDirectory()) {\r\n                File[] files = dir.listFiles();\r\n                \r\n                if(files == null) {\r\n                    System.out.println(\"\u914d\u4e0b\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\");\r\n                }\r\n                \/\/for\u6587\u3067\u30d5\u30a1\u30a4\u30eb\u30ea\u30b9\u30c8\u5206\u30eb\u30fc\u30d7\u3059\u308b\r\n                for(int i=0; i&lt;files.length; i++) {\r\n                    \r\n                    File file = files[i];\r\n                    \r\n                    System.out.println(file.toString());\r\n                    \r\n                    \/\/\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u78ba\u8a8d\r\n                    if(files[i].exists() == false) {\r\n                        continue;\r\n                    \/\/\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u5408\u306f\u518d\u5e30\u7684\u306b\u81ea\u8eab\u3092\u547c\u3073\u51fa\u3057\u3066\u524a\u9664\u3059\u308b\r\n                    } else if(files[i].isFile()) {\r\n                        \/\/\u62e1\u5f35\u5b50\u304c\".java\"\u3067\u3042\u308c\u3070\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\r\n                        if(file.getPath().endsWith(\".java\")) {\r\n                            fileClass(files[i]);\r\n                            System.out.println(\"\u30d5\u30a1\u30a4\u30eb\u524a\u96642\");\r\n                        }\r\n                    }        \r\n                }\r\n            }\r\n        } else {\r\n            System.out.println(\"\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5b58\u5728\u3057\u306a\u3044\");\r\n        }\r\n    }\r\n}\r\n\r\npublic class FileDelete {\r\n\r\n    public static void main(String[] args) {\r\n        FileClass fc = new FileClass();\r\n        File dir = new File(\"\/Users\/Shared\/java\/\");\r\n        FileClass.fileClass(dir);\r\n    }\r\n\r\n}<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001<span style=\"color: #339966;\"><strong>listFiles<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3067<span style=\"color: #0000ff;\"><strong>\u53d6\u5f97\u3057\u305f\u30ea\u30b9\u30c8<\/strong><\/span>\u5206\u30eb\u30fc\u30d7\u3057\u3001<span style=\"color: #339966;\"><strong>getPath<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3068<span style=\"color: #0000ff;\"><strong>\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u53d6\u5f97<\/strong><\/span>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #339966;\"><strong>endsWith<\/strong><\/span>\u30e1\u30bd\u30c3\u30c9\u3067\u62e1\u5f35\u5b50\u304c\u201d.java\u201d\u306e\u5834\u5408\u306f\u3001<span style=\"color: #0000ff;\"><strong>\u518d\u5e30\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664<\/strong><\/span>\u3059\u308b\u51e6\u7406\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>File\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u65b9\u3078<\/h2>\n<p>File\u30af\u30e9\u30b9\u306e\u3055\u307e\u3056\u307e\u306a\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/24786\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/06\/java_class_all-150x85.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">Java\u306eFile\u30af\u30e9\u30b9\u3092\u30de\u30b9\u30bf\u30fc\uff01\u57fa\u790e\u304b\u3089\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u307e\u3067\u7dcf\u307e\u3068\u3081<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3053\u3053\u3067\u306fFile\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308bdelete\u30e1\u30bd\u30c3\u30c9\u3084\u5fdc\u7528\u7684\u306a\u524a\u9664\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u51e6\u7406\u81ea\u4f53\u306f\u3001delete\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3060\u3051\u3067\u7c21\u5358\u306b\u884c\u3048\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u307e\u3068\u3081\u3066\u524a\u9664\u3057\u305f\u308a\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u3067\u524a\u9664\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u51e6\u7406\u3092\u5de5\u592b<\/strong><\/span>\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u3082\u3057\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u51e6\u7406\u3092\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f\u3089\u3001\u3053\u306e\u8a18\u4e8b\u3092\u601d\u3044\u51fa\u3057\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u30d5\u30ea\u30fc\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30e4\u30de\u30b7\u30bf\u3067\u3059\u3002 Java\u3067\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306b\u4f7f\u7528\u3059\u308bFile\u30af\u30e9\u30b9\u306f\u3055\u307e\u3056\u307e\u306a\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u3067\u5fc5\u8981\u306a\u3001 \u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5 \u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5 \u3068\u3044 [&hellip;]<\/p>\n","protected":false},"author":11989,"featured_media":30778,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2344],"tags":[67],"class_list":["post-20626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-study","tag-java"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/20626\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/20626\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-31T14:23:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:41:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u30e4\u30de\u30b7\u30bf\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626\"},\"author\":{\"name\":\"\u30e4\u30de\u30b7\u30bf\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/6bf59bda7c41edab50c558fa6db8bd3d\"},\"headline\":\"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)\",\"datePublished\":\"2017-03-31T14:23:21+00:00\",\"dateModified\":\"2024-05-06T02:41:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626\"},\"wordCount\":52,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/Java-delete.jpg\",\"keywords\":[\"Java\"],\"articleSection\":[\"Java\u5b66\u7fd2\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626\",\"name\":\"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/Java-delete.jpg\",\"datePublished\":\"2017-03-31T14:23:21+00:00\",\"dateModified\":\"2024-05-06T02:41:13+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/Java-delete.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/Java-delete.jpg\",\"width\":700,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/20626#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/6bf59bda7c41edab50c558fa6db8bd3d\",\"name\":\"\u30e4\u30de\u30b7\u30bf\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g\",\"caption\":\"\u30e4\u30de\u30b7\u30bf\"},\"description\":\"\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u306610\u5e74\u52e4\u52d9\u2192\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u3078\u3002 \u5927\u898f\u6a21\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u304b\u3089Web\u30a2\u30d7\u30ea\u958b\u767a\u307e\u3067\u7d4c\u9a13\u3042\u308a\u3002\u6700\u8fd1\u3067\u306fPython\u306e\u6a5f\u68b0\u5b66\u7fd2\u306b\u6311\u6226\u4e2d\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5b66\u8005\u306b\u5411\u3051\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u3001\u305f\u3081\u306b\u306a\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u4f5c\u308a\u3092\u5fc3\u304c\u3051\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/yamasitatakashi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/20626","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/20626","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_published_time":"2017-03-31T14:23:21+00:00","article_modified_time":"2024-05-06T02:41:13+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg","type":"image\/jpeg"}],"author":"\u30e4\u30de\u30b7\u30bf","twitter_card":"summary_large_image","twitter_creator":"@samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/20626#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/20626"},"author":{"name":"\u30e4\u30de\u30b7\u30bf","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/6bf59bda7c41edab50c558fa6db8bd3d"},"headline":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)","datePublished":"2017-03-31T14:23:21+00:00","dateModified":"2024-05-06T02:41:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/20626"},"wordCount":52,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/20626#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg","keywords":["Java"],"articleSection":["Java\u5b66\u7fd2"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/20626","url":"https:\/\/www.sejuku.net\/blog\/20626","name":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/20626#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/20626#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg","datePublished":"2017-03-31T14:23:21+00:00","dateModified":"2024-05-06T02:41:13+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a) \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/20626#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/20626"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/20626#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/08\/Java-delete.jpg","width":700,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/20626#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Java\u5165\u9580\u3011File\u306e\u524a\u9664(delete\u3001\u5f37\u5236\u524a\u9664\u3001\u62e1\u5f35\u5b50\u306e\u6307\u5b9a)"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/6bf59bda7c41edab50c558fa6db8bd3d","name":"\u30e4\u30de\u30b7\u30bf","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a222133d6e03ef18e173d070f10266919342e49f09ab7ca86ceb5e49c66234c7?s=96&d=mm&r=g","caption":"\u30e4\u30de\u30b7\u30bf"},"description":"\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u306610\u5e74\u52e4\u52d9\u2192\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u3078\u3002 \u5927\u898f\u6a21\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u304b\u3089Web\u30a2\u30d7\u30ea\u958b\u767a\u307e\u3067\u7d4c\u9a13\u3042\u308a\u3002\u6700\u8fd1\u3067\u306fPython\u306e\u6a5f\u68b0\u5b66\u7fd2\u306b\u6311\u6226\u4e2d\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5b66\u8005\u306b\u5411\u3051\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u3001\u305f\u3081\u306b\u306a\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u4f5c\u308a\u3092\u5fc3\u304c\u3051\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.sejuku.net\/blog\/author\/yamasitatakashi"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/20626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/11989"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=20626"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/20626\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/30778"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=20626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=20626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=20626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}