getSharedLink is returning garbage

回答済み
新規投稿

コメント

3件のコメント

  • mwiller

     Hey, I'm Matt and my team maintains the Box Java SDK — I'm happy to help you out here!  The output you're seeing isn't garbage, it's just Java telling you that what you're dealing with is an Object of some sort that doesn't have an overridden .toString() method (specifically one with type com.box.sdk.BoxSharedLink).  If you look at the Javadocs for the getSharedLink() method, you'll see that it returns this type of object, not a String.  To get the actual URL string, you'll need to something like this:

     

    BoxSharedLink sharedLink = itemInfo.getSharedLink();
    if (sharedLink != null) {
        String sharedLinkURL = sharedLink.getURL();
        // do something with the shared link URL
    }
    0
    コメントアクション パーマリンク
  • LandC

    Matt,

     

    Thank you for your prompt response.  My apologies for such a simple oversight.  I used your code below and it worked like a charm!

     

    LandC

    0
    コメントアクション パーマリンク
  • mwiller

    No problem — glad you got it working!

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。