Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7493067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:44:11+00:00 2026-05-29T16:44:11+00:00

this is not really a problem I have, but more a question about good

  • 0

this is not really a problem I have, but more a question about good practice.

I want to resolve a URL of a File of my eclipse plugin, but there are many ways which work. I could not find anything about which one should be preferred.

First of all: how should I obtain my bundle? Through the Activator or the Platform?

Bundle bundle = Platform.getBundle("my.bundle.id");

or

Bundle bundle = Activator.getDefault().getBundle();

The other question is how to get the url. Either with

URL url = FileLocator.find(bundle, new Path("folder/file.txt"), null);

or

URL url = bundle.getEntry("folder/file.txt");

All of this works, but which way is the best? Does it even make a difference?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:44:13+00:00Added an answer on May 29, 2026 at 4:44 pm

    No it doesn’t make any difference (actually FileLocator uses bundle.getEntry). The advantage is of using bundle.getEntry is that you don’t have a dependency to an eclipse-bundle; I don’t know if that fact is relevant for you.

    I’m always using the FileLocator method in RCPs but using the openStream method to read the contents of files within bundles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not really a question about addressing a specific problem but more a
This is not really a question because I just solved the problem, but I
This is not really a programming question, more of an algorithmic one. The problem:
This is not really a programming question but please bear with me as I
This is not a really technical question but is required for a system I
This is not a really Programming Question, but please bear with me as it's
This is a question not really about programming (is not specific to any language
I have a question about optimization, but more on the browser/client side. I am
NOTE: This question changed a little as I learned more about the problem, so
This may not really sound hard to do but it is currently killing me.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.