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 6774407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:47:00+00:00 2026-05-26T15:47:00+00:00

I have an Eclipse plugin where the user can select files or folders. Currently

  • 0

I have an Eclipse plugin where the user can select files or folders. Currently I’m storing the absolute paths in a configuration file. Since the configuration file is shared between users (e.g. with SVN) the absolute paths are a problem.

My configuration file currently looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<paths>
    <path value="C:\Users\UserA\someFolder\foo.jar"/>
    <path value="C:\Users\UserA\someFolder\bar.jar"/>
</paths>

In order to fix the problem I’d like to use the Linked Resources feature of Eclipse. So, when the user defines a path variable (Eclipse preferences -> General -> Workspace -> Linked Resources) with the name MY_JARS and a value of “C:\Users\UserA\someFolder” the configuration file my plugin writes should look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<paths>
    <path value="${MY_JARS}\foo.jar"/>
    <path value="${MY_JARS}\bar.jar"/>
</paths>

How can I replace certain parts of a path by variable names that are defined in Eclipse’s Linked Resources? And how can I revert this when I’m reading the path from the configuration file in order to get a correct absolute path?

I’ve looked at IPathVariableManager which looks quite promising. However, I couldn’t figure out how to use it properly.

  • 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-26T15:47:00+00:00Added an answer on May 26, 2026 at 3:47 pm

    Assuming that user specifies an absolute path and you want to replace it with relative path using any matching defined variable, you’d use IPathVariableManager.convertToRelative(...). To get absolute path from relative, use IPathVariableManager.resolveURI(...).

    Naturally, this assumes that the variable is defined in all environments where the configuration file is used, which might not always be the case. Therefore, it is better to let users specify paths with known variables rather than convert automatically behind the scenes.

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

Sidebar

Related Questions

I have built a simple Eclipse plugin where a user may use a TableViewer
I have installed eclipse JDE plugin (ie BlackBerry_JDE_PluginFull_1.0.0.67.exe) , i can create a blackberry
I have created an Eclipse plugin which creates a view in Eclipse. Currently it
I am developing a plugin in eclipse which can generate a text file (based
I'm writing a simple eclipse plugin, which is a code generator. User can choose
In Eclipse (3.3) I have a plugin User , depending on plugin Provider .
I have an Eclipse plugin with a view (ViewPart) which can be opened as
I have created a plugin project in Eclipse, distributed as a jar. The user
I'd like to have my Eclipse plugin cause a URL to be opened by
I have an Eclipse RCP plugin that requires a DLL. What is the recommended

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.