Skip to content

Commit 49daeb7

Browse files
committed
Skeleton for listcourses.
1 parent 55f6d79 commit 49daeb7

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
import fi.helsinki.cs.tmc.utilities.BgTaskListenerList;
1515
import fi.helsinki.cs.tmc.utilities.CancellableCallable;
1616
import hy.tmc.core.TmcCore;
17+
import hy.tmc.core.exceptions.TmcCoreException;
1718
import java.util.ArrayList;
1819
import java.util.List;
1920
import java.util.logging.Level;
2021
import java.util.logging.Logger;
21-
import org.apache.http.auth.Credentials;
2222
import org.openide.util.Exceptions;
2323

2424
/**
@@ -61,22 +61,26 @@ public RefreshCoursesAction addListener(BgTaskListener<List<Course>> listener) {
6161
}
6262

6363
public void run() {
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-
// });
64+
// try {
65+
// Credentials credentials = new Credentials(this.tmcSettings.getUsername(),
66+
// this.tmcSettings.getPassword()) {};
67+
// System.out.println(credentials);
68+
// ListenableFuture<Boolean> login = this.tmcCore.login(credentials, tmcSettings.getServerBaseUrl()+"/user");
69+
// Futures.addCallback(login, new FutureCallback<Boolean>() {
70+
// @Override
71+
// public void onSuccess(Boolean loginSuccess) {
72+
//
73+
// }
74+
//
75+
// @Override
76+
// public void onFailure(Throwable thrwbl) {
77+
// System.out.println("LOGIN LATAUS FEILASI1: " );
78+
// Exceptions.printStackTrace(thrwbl);
79+
// }
80+
// });
81+
// } catch (TmcCoreException ex) {
82+
// Exceptions.printStackTrace(ex);
83+
// }
8084
}
8185

8286
public void oldRun() {

0 commit comments

Comments
 (0)