Package com.aetrion.flickr.auth

Examples of com.aetrion.flickr.auth.Auth


            e.printStackTrace();
        }
*/
       
        AuthInterface authInterface = flickr.getAuthInterface();
        Auth auth = authInterface.checkToken("72157625348978315-7c9ef5a03dc17410");
        RequestContext context = RequestContext.getRequestContext();
        context.setAuth(auth);

        Uploader up = new Uploader(key, shared);
        File file = new File("test.png");
View Full Code Here


                            key,shared,
                            new REST()
                    );

                    AuthInterface authInterface = flickr.getAuthInterface();
                    Auth auth = authInterface.checkToken(context.getSettings().getProperty(FLICKR_USER_TOKEN));
                    RequestContext context = RequestContext.getRequestContext();
                    context.setAuth(auth);

                    Uploader up = new Uploader(key, shared);
                    UploadMetaData meta = new UploadMetaData();
View Full Code Here

                    }))
                    .addControl(new Button("Continue >").onClicked(new Callback<ActionEvent>(){
                        public void call(ActionEvent event) {
                            stage.hide();
                            try {
                                Auth auth = authInterface.getToken(frob);
                                System.out.println("Authentication success");
                                // This token can be used until the user revokes it.
                                System.out.println("Token: " + auth.getToken());
                                String user_token = auth.getToken();
                                ChangeFlickrSettingsAction.this.context.getSettings().setProperty(FLICKR_USER_TOKEN,user_token);
                                String user_id = auth.getUser().getId();
                                ChangeFlickrSettingsAction.this.context.getSettings().setProperty(FLICKR_USER_ID,user_id);
                                System.out.println("nsid: " + auth.getUser().getId());
                                System.out.println("Realname: " + auth.getUser().getRealName());
                                System.out.println("Username: " + auth.getUser().getUsername());
                                System.out.println("Permission: " + auth.getPermission().getType());
                            } catch (FlickrException e) {
                                System.out.println("Authentication failed");
                                e.printStackTrace();
                            } catch (SAXException e) {
                                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here

                        if (iter.hasNext()) {
                            out.writeBytes("&");
                        }
                    }

                    Auth auth = requestContext.getAuth();
                    if (auth != null) {
                        // will be added at AuthUtilities.addAuthToken()
                        //out.writeBytes("&auth_token=");
                        //out.writeBytes(auth.getToken());
                        //out.writeBytes("&api_sig=");
View Full Code Here

    File[] authFiles = authStoreDir.listFiles(new AuthFilenameFilter());
   
    for (int i = 0; i < authFiles.length; i++) {
      if (authFiles[i].isFile() && authFiles[i].canRead()) {
        ObjectInputStream authStream = new ObjectInputStream(new FileInputStream(authFiles[i]));
        Auth authInst = null;
        try {
          authInst = (Auth)authStream.readObject();
        } catch (ClassCastException cce) {
          // ignore.  Its not an auth, so we won't store it.  simple as that :-);
        } catch (ClassNotFoundException e) {
          // yep, ignoring. LALALALALLALAL.  I can't hear you :-)
        }
        if (authInst != null) {
          this.auths.put(authInst.getUser().getId(), authInst);
        }
      }
    }
  }
View Full Code Here

   
  }
 
  public static void main(String[] args) throws Exception {
    FileAuthStore fas = new FileAuthStore(new File(System.getProperty("user.home") + File.separatorChar + "flickrauth"));
    Auth a = new Auth();
    User u = new User();
    u.setId("THISISMYNSID");
    a.setUser(u);
    fas.store(a);
    fas = null;
   
    fas = new FileAuthStore(new File(System.getProperty("user.home") + File.separatorChar + "flickrauth"));
    Auth a2 = fas.retrieve("THISISMYNSID");
   
    System.out.println(a2.getUser().getId());
  }
View Full Code Here

TOP

Related Classes of com.aetrion.flickr.auth.Auth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.