Skip to content

Commit 55f6d79

Browse files
committed
Skeleton for refreshCoursesACtion.
1 parent f9fa0b7 commit 55f6d79

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/actions/RefreshCoursesAction.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.List;
1919
import java.util.logging.Level;
2020
import java.util.logging.Logger;
21+
import org.apache.http.auth.Credentials;
2122
import org.openide.util.Exceptions;
2223

2324
/**
@@ -60,22 +61,22 @@ public RefreshCoursesAction addListener(BgTaskListener<List<Course>> listener) {
6061
}
6162

6263
public void run() {
63-
Credentials credentials = new Credentials(this.tmcSettings.getUsername(),
64-
this.tmcSettings.getPassword());
65-
System.out.println(credentials);
66-
ListenableFuture<Boolean> login = this.tmcCore.login(credentials, tmcSettings.getServerBaseUrl());
67-
Futures.addCallback(login, new FutureCallback<Boolean>() {
68-
@Override
69-
public void onSuccess(Boolean v) {
70-
System.out.println("TOIMIIIII: " + v);
71-
}
72-
73-
@Override
74-
public void onFailure(Throwable thrwbl) {
75-
System.out.println("LOGIN LATAUS FEILASI1: " );
76-
Exceptions.printStackTrace(thrwbl);
77-
}
78-
});
64+
// Credentials credentials = new Credentials(this.tmcSettings.getUsername(),
65+
// this.tmcSettings.getPassword()) {};
66+
// System.out.println(credentials);
67+
// ListenableFuture<Boolean> login = this.tmcCore.login(credentials, tmcSettings.getServerBaseUrl());
68+
// Futures.addCallback(login, new FutureCallback<Boolean>() {
69+
// @Override
70+
// public void onSuccess(Boolean v) {
71+
// System.out.println("TOIMIIIII: " + v);
72+
// }
73+
//
74+
// @Override
75+
// public void onFailure(Throwable thrwbl) {
76+
// System.out.println("LOGIN LATAUS FEILASI1: " );
77+
// Exceptions.printStackTrace(thrwbl);
78+
// }
79+
// });
7980
}
8081

8182
public void oldRun() {

tmc-plugin/src/fi/helsinki/cs/tmc/model/ServerAccess.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public CancellableCallable<Course> getFullCourseInfoTask(Course courseStub) {
137137
public Course call() throws Exception {
138138
try {
139139
String text = download.call();
140+
System.out.println(text);
140141
return courseInfoParser.parseFromJson(text);
141142
} catch (FailedHttpResponseException ex) {
142143
return checkForObsoleteClient(ex);

0 commit comments

Comments
 (0)