{"id":720,"date":"2007-07-17T11:46:33","date_gmt":"2007-07-17T11:46:33","guid":{"rendered":"http:\/\/www.msinterdev.org\/wp\/2007\/07\/17\/ftp%eb%9d%bc%ec%9d%b4%eb%b8%8c-%eb%9f%ac%eb%a6%ac-%ec%9d%b4%ec%9a%a9-%ed%8c%8c%ec%9d%bc-%ec%a0%80%ec%9e%a5-channel-%ec%82%ac%ec%9a%a9\/"},"modified":"2007-07-17T11:46:33","modified_gmt":"2007-07-17T11:46:33","slug":"ftp%eb%9d%bc%ec%9d%b4%eb%b8%8c-%eb%9f%ac%eb%a6%ac-%ec%9d%b4%ec%9a%a9-%ed%8c%8c%ec%9d%bc-%ec%a0%80%ec%9e%a5-channel-%ec%82%ac%ec%9a%a9","status":"publish","type":"post","link":"http:\/\/www.msinterdev.org\/wp\/2007\/07\/17\/ftp%eb%9d%bc%ec%9d%b4%eb%b8%8c-%eb%9f%ac%eb%a6%ac-%ec%9d%b4%ec%9a%a9-%ed%8c%8c%ec%9d%bc-%ec%a0%80%ec%9e%a5-channel-%ec%82%ac%ec%9a%a9\/","title":{"rendered":"FTP\ub77c\uc774\ube0c \ub7ec\ub9ac \uc774\uc6a9 \ud30c\uc77c \uc800\uc7a5. channel \uc0ac\uc6a9."},"content":{"rendered":"<p>channel \uc744 \ucc98\uc74c \uc0ac\uc6a9\ud574 \ubd24\uc2b5\ub2c8\ub2e4. <\/p>\n<p>clear \uc640 flip \uc744 \uc801\uc808\ud788 \uc0ac\uc6a9\ud558\uc5ec \ubc1b\uc544\uc624\ub294 \ub370\uc774\ud130\ub97c \uc54c \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4. <\/p>\n<p>flip\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0 \ucd5c\ucd08 \uc14b\ud305\ub41c 128 Byte\uc758 \uacf5\uac04\uc744 \ubaa8\ub450 \uc800\uc7a5 \ud558\uac8c \ub418\uc5b4 \ub9c8\uc9c0\ub9c9\uc5d0 0x00 \uc774 <\/p>\n<p>\uae30\ub85d \ub418\uc5b4 \ubc84\ub9bd\ub2c8\ub2e4. <\/p>\n<p>\uc11c\ub450\uac00 \uc5c6\uae30\uc5d0 \uae00\uc774 \uc5b4\ub5a4 \ub0b4\uc6a9\uc778\uc9c0 \uc54c\uc544\uba39\uae30 \uc5b4\ub835\uc9c0\ub9cc, \ub098\ub984 \uc800\ub9cc \uc54c\uc544 \uba39\ub3c4\ub85d \ud558\uaca0\uc2b5\ub2c8\ub2e4. <\/p>\n<p>^.^<\/p>\n<p>public long getFile(String strRemoteFile, String strLocalFile) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; FtpInputStream fileInputStream = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; ByteBuffer byteBuf = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; FileChannel fileChannelOut = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; FileOutputStream fileOutputStream = null;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; int size = 0;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; byte[] byteBuff = new byte[128];<br \/>&nbsp; &nbsp; &nbsp; &nbsp; long longTotalByte = 0;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; \/* source FtpFile remote file *\/<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FtpFile file = new FtpFile(strRemoteFile, this.objFTP);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/* open ftp input stream *\/<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileInputStream = new FtpInputStream(file);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileOutputStream &nbsp;&nbsp; = new FileOutputStream(strLocalFile); <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileChannelOut &nbsp; &nbsp; &nbsp; &nbsp; = fileOutputStream.getChannel();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteBuf = ByteBuffer.allocate(byteBuff.length);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while( 0 &lt; ( <STRONG>size<\/STRONG> =&nbsp; fileInputStream.read(byteBuff) ) ){<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteBuf.<STRONG><FONT color=#ff0000>clear();<br \/><\/FONT><\/STRONG>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteBuf.put(byteBuff, 0 , <STRONG>size<\/STRONG>); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteBuf.<STRONG><FONT color=#008000>flip();<\/FONT><\/STRONG><br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileChannelOut.write(<STRONG><FONT color=#cc9900>byteBuf<\/FONT><\/STRONG>);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; longTotalByte += size;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; } <br \/>&nbsp; &nbsp; &nbsp; &nbsp; catch (IOException e) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; longTotalByte = 0;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; } <br \/>&nbsp; &nbsp; &nbsp; &nbsp; finally { <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/* close ftp input stream <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * this must be always run *\/<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (fileInputStream != null)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileChannelOut.close();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileOutputStream.close();<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileInputStream.close(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (IOException e) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; longTotalByte =&nbsp; 0;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return longTotalByte; &nbsp; &nbsp; &nbsp;&nbsp; <br \/>&nbsp; &nbsp; }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>channel \uc744 \ucc98\uc74c \uc0ac\uc6a9\ud574 \ubd24\uc2b5\ub2c8\ub2e4. clear \uc640 flip \uc744 \uc801\uc808\ud788 \uc0ac\uc6a9\ud558\uc5ec \ubc1b\uc544\uc624\ub294 \ub370\uc774\ud130\ub97c \uc54c \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4. flip\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0 \ucd5c\ucd08 \uc14b\ud305\ub41c 128 Byte\uc758 \uacf5\uac04\uc744 \ubaa8\ub450 \uc800\uc7a5 \ud558\uac8c \ub418\uc5b4 \ub9c8\uc9c0\ub9c9\uc5d0 0x00 \uc774 \uae30\ub85d \ub418\uc5b4 \ubc84\ub9bd\ub2c8\ub2e4. \uc11c\ub450\uac00 \uc5c6\uae30\uc5d0 \uae00\uc774 \uc5b4\ub5a4 \ub0b4\uc6a9\uc778\uc9c0 \uc54c\uc544\uba39\uae30 \uc5b4\ub835\uc9c0\ub9cc, \ub098\ub984 \uc800\ub9cc \uc54c\uc544 \uba39\ub3c4\ub85d \ud558\uaca0\uc2b5\ub2c8\ub2e4. ^.^ public long getFile(String strRemoteFile, String strLocalFile) {&nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[608,609,115],"class_list":["post-720","post","type-post","status-publish","format-standard","hentry","category-about-knowledge-programs_java","tag-channel","tag-609","tag-115"],"_links":{"self":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts\/720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/comments?post=720"}],"version-history":[{"count":0,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.msinterdev.org\/wp\/wp-json\/wp\/v2\/tags?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}