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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:41:32+00:00 2026-06-15T01:41:32+00:00

I am developing a component which generates code based on templates inside java class.

  • 0

I am developing a component which generates code based on templates inside java class. The project use clearcase as SCM. After the code update, the files are in read-only state. If i am adding anything to any java class, i have to make it hijack and paste the source code templates inside the class. Let’s suppose the jAutoDoc plugin which is used for adding comment. If user select a class, click on generate comment. The comment will not paste if the file is not in write mode.

Clearcase Plugin Vendor : IBM Rational.

Eclipse Version : 3.5

Please help. Is there any way to do hijack a file from java code?

Thanks in advance..

  • 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-15T01:41:33+00:00Added an answer on June 15, 2026 at 1:41 am

    Thanks VonC.

    For making a java file in write mode through eclipse JDT API. This method will set the preference “read only” of the resource to “false”.

    private static void setCompilationUnitWriteMode(ICompilationUnit cu) throws CoreException {
    
            ResourceAttributes resourceAttributes = cu.getResource().getResourceAttributes();
    
            if (resourceAttributes != null) {
                  // Setting Writemode true
                resourceAttributes.setReadOnly(false);
            cu.getResource().setResourceAttributes(resourceAttributes);
        }
      }
    

    For Non Java Resource

    First create the IFile object, set the preference “read only” of the resource to “false”.

           IFile file = path.getFile() 
    
            file.getFile().getResourceAttributes();
    
            if (resourceAttributes != null) {
                resourceAttributes.setReadOnly(false);
                file.setResourceAttributes(resourceAttributes);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am in the process of developing a seperate java component which will be
I am currently developing a GTK# application which will use a component to view
I'm developing an API which will also have an authentication/authorization component. Anybody, regardless of
Considering this article Developing a MVC component for Joomla , following is the code
I'm developing a XPCOM C++ component that have to use some RegExps functions Does
I'm currently developing a component based API that is heavily stateful. The top level
I am developing a swing app, where I have a Factory class which provide
I'm developing a webapp which has a portal-ish component to it (think like multiple
I'm developing a server component that will serve requests for a embedded client, which
We're developing a server application in Java (1.6) which is a transactional server, that

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.