Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How can i get a auth through my java code

my java code is :
public static void main(String[] args) {
try {
String urlStr="https://nsjazz.raleigh.ibm.com:8017/jazz/oslc/contexts/_6Lg3ID0CEd-HhfkZ2zavEQ/workitems.xml?oslc_cm.query=oslc_cm%3AsearchTerms%3D%22Test%20fetch%20TTT%20data%20based%20on%20Domino%20on%20Windows%22&oslc_cm.properties=dc:identifier,dc:title,rtc_cm:ownedBy{dc:title}";
URL url=new URL(urlStr);
String theUsername="luxianan@cn.ibm.com";
String thePassword="summer8765";
String userPassword=theUsername + ":" + thePassword;
String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
URLConnection uc = url.openConnection();
uc.setRequestProperty ("Authorization", "Basic " + encoding);
InputStream content=(InputStream)uc.getInputStream();
BufferedReader in=new BufferedReader(new InputStreamReader(content));
String line;
while((line=in.readLine())!=null){
System.out.println(line);
}

} catch (Exception e) {
e.printStackTrace();
}
but i could not get the page info from the url,why?

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 24 '10, 4:05 a.m.

Question was seen: 3,015 times

Last updated: Aug 24 '10, 4:05 a.m.

Confirmation Cancel Confirm