jsoup - How to get this property value in my java code? -


i'm learning java , have problem retrieve information need objects...

when debug code can see in targetfile, path property don't know how in code.

this screenshot: ide debug view http://pix.toile-libre.org/upload/original/1395651483.png

this complete code:

package com.example.helloworld;  import com.github.axet.wget.wget; import com.github.axet.wget.info.downloadinfo; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element;  import java.io.file; import java.io.ioexception; import java.net.url;  public class helloworld {      public static void main(string[] args) throws ioexception {          nodejs();      }      public static void nodejs() throws ioexception {          // scrap download url.         document doc = jsoup.connect("http://nodejs.org/download").get();         element link = doc.select("div.interior:nth-child(2) > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(3) > a:nth-child(1)").first();         string url = link.attr("abs:href");          // print download url.         system.out.println(url);          // download file via scraped url.         url download = new url(url);         file target = new file("/home/lan/desktop/");         wget w = new wget(download, target);         w.download();          // targetfile property         // ???      }  } 

how can value?

i not know code field interested in may encapsulated , not accessible in code, debugger can see @ runtime :)

update: https://github.com/axet/wget/blob/master/src/main/java/com/github/axet/wget/wget.java

the field default package, can access within package. can frustrating @ times, should ask why designers of class decided hide field.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -