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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:25:00+00:00 2026-06-03T15:25:00+00:00

Why this piece of java code looks for a file in my Home directory?

  • 0

Why this piece of java code looks for a file in my Home directory? Why it’s not in my eclipse workspace (/home/user/eclipse/workspace/)?

import org.eclipse.emf.common.util.URI;

URI uri = null;
try {
    uri = URI.createURI("../models/task.cm");
    Resource resource = resourceSet.getResource(uri, true);
...
  • 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-06-03T15:25:01+00:00Added an answer on June 3, 2026 at 3:25 pm

    getResource

    Resource getResource(URI uri, boolean loadOnDemand)

    Returns the resource resolved by the URI.
    

    A resource set is expected to implement the following strategy in order to resolve the given URI to a resource. First it uses it’s URI converter to normalize the URI and then to compare it with the normalized URI of each resource; if it finds a match, that resource becomes the result. Failing that, it delegates to allow the URI to be resolved elsewhere. For example, the package registry is used to resolve the namespace URI of a package to the static instance of that package. So the important point is that an arbitrary implementation may resolve the URI to any resource, not necessarily to one contained by this particular resource set. If the delegation step fails to provide a result, and if loadOnDemand is true, a resource is created and that resource becomes the result. If loadOnDemand is true and the result resource is not loaded, it will be loaded before it is returned.

    Parameters:
        uri - the URI to resolve.
        loadOnDemand - whether to create and load the resource, if it doesn't 
        already exists. 
    Returns:
        the resource resolved by the URI, or null if there isn't one and it's not 
        being demand loaded. 
    Throws:
        java.lang.RuntimeException - if a resource can't be demand created. 
        WrappedException - if a problem occurs during demand load.
    

    So, The resource is not found, and an arbitrary resource is created in your home directory.

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

Sidebar

Related Questions

How i will run this piece of java code???? import java.io.Console; import java.util.Arrays; /**
Let's consider this piece of code as our example: import java.awt.*; class Maze extends
I am using iTextSharp in VB.net. I have this piece of code from java
I have a piece of code VERY similar to this one http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailFetching I the
This piece of code is from Adobe docs : package { import flash.display.Loader; import
This piece of code used to work in MVC 1 but it does not
I've got this piece of Java code with embedded Rhino (irrelevant bits omitted): Context
I have a piece of java code which reads strings from a file and
Can someone show me a piece of java code that parses this date: 2009-08-05
I have this piece of code in my java class mystring = mysuperstring.split(/); I

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.