How do I extract remote goto links from PDF?

Q: I have a PDF document and it has a bunch of links to other PDF
files in the same directory
I load it up just like here:
I enumerate annotations and pick those that have e_Link type and their
actions are all e_GoToR and they have no destinations.

How do I get meaningful destinations for those links? I need those
links because they're pointing to other PDF files that I need to
follow (we're working on a filesystem-based PDF crawler).

Here is my code:

for (PageIterator itr = doc.getPageIterator(); itr.hasNext(); )
     Page page = (Page)(;
     int num_annots = page.getNumAnnots();
     for (int i = 0; i < num_annots; ++i)
         Annot annot = page.getAnnot(i);
         if (annot.isValid() == false) continue;

         if (annot.getType() == Annot.e_Link){
             Link link = new Link(annot);
             Action action = link.getAction();
             if (action.isValid()){
                 int atype = action.getType(); // returns e_GoToR
                 // now what?
                 // action.getDest() throws an exception
                 // And action.getSDFObj() gives me a dictionary with
keys that have no meaning

Thank you!
A: If you search for ‘e_GoToR’ in PDFNet KB (
group/pdfnet-sdk) you will a few relevant articles. The following are
some of the relevant entries:

// C# pseudocode (it should be simple to translate to JAVA)

int num_annots = page.GetNumAnnots();
for (int i=0; i<num_annots; ++i) {
  Annot annot = page.GetAnnot(i);
  if (annot.GetType() == Annot.Type.e_Link) {
    Action action = annot.GetLinkAction();
    if (action.GetType() == Action::e_GoTo) {
      int page_num = action.GetDest().GetPage().GetIndex();
    else if (action.GetType() == Action::e_GoToR) {
       // A remote/external goto action...
         Destination dest = action.GetDest();
        // Get the file specification dict
        Obj file_dict = action.GetSDFObj().Get("F").Value();
        FileSpec file_spec = new FileSpec(file_dict);
        String file_path = file_spec.GetFilePath();