
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>daniel shiffman &#187; sftp</title>
	<atom:link href="http://www.shiffman.net/category/sftp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shiffman.net</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jan 2012 03:41:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Sftp with Java / Processing</title>
		<link>http://www.shiffman.net/2007/06/04/sftp-with-java-processing/</link>
		<comments>http://www.shiffman.net/2007/06/04/sftp-with-java-processing/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 20:29:22 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[p5]]></category>
		<category><![CDATA[processing.org]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://www.shiffman.net/2007/06/04/sftp-with-java-processing/</guid>
		<description><![CDATA[I know, I know, you&#8217;ve been waiting your whole life for this. Download beta SFTP Processing library (source and example included in zip). The library uses JSch (Java Secure Channel). Copyright (c) 2002,2003,2004,2005,2006,2007 Atsuhiko Yamanaka, JCraft, Inc. import sftp.*; &#160; &#8230; <a href="http://www.shiffman.net/2007/06/04/sftp-with-java-processing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know, I know, you&#8217;ve been waiting your whole life for this.</p>
<p><a href="http://www.shiffman.net/p5/libraries/sftp/sftp.zip">Download beta SFTP Processing library</a> (source and example included in zip).</p>
<p>The library uses <a href="http://www.jcraft.com/jsch/">JSch (Java Secure Channel)</a>.<br />
Copyright (c) 2002,2003,2004,2005,2006,2007 Atsuhiko Yamanaka, JCraft, Inc.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">sftp.*</span><span style="color: #339933;">;</span>
&nbsp;
Sftp sftp<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Create the SFTP object</span>
  <span style="color: #666666; font-style: italic;">// if 3rd arg = false, you must set the password in your code</span>
  <span style="color: #666666; font-style: italic;">// if 3rd arg = true, you will be prompted to enter your password</span>
  sftp <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Sftp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;www.hostname.com&quot;</span>,<span style="color: #0000ff;">&quot;login&quot;</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// sftp.setPassword(&quot;XXXXXX&quot;);</span>
  sftp.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// start the thread</span>
  noLoop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> mousePressed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// At any point you can execute an SFTP command </span>
  <span style="color: #666666; font-style: italic;">// Not all commands are currently implemented</span>
  <span style="color: #666666; font-style: italic;">// but you do have &quot;ls&quot; and &quot;get&quot;</span>
  <span style="color: #666666; font-style: italic;">// Gosh, I should implement &quot;put&quot;, sorry!</span>
  sftp.<span style="color: #006633;">executeCommand</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ls&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  sftp.<span style="color: #006633;">executeCommand</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;get file.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shiffman.net/2007/06/04/sftp-with-java-processing/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

