Re: Is it possible to read / edit standard project properties?

Oliver Rettig <[email protected]> Sun, 16 Apr 2017 15:12:33 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Organization ORAT
Message-ID <2386427.iyZLNjSViZ@l560>
Hi Geertjan,

thats really great. The only thing I do not understand is the comment about

ProjectManager.mutex().writeAccess(...)

that should be used for writing.

Can you help?

best regards
Oliver

> Maybe this helps:
> https://blogs.oracle.com/geertjan/entry/setting_netbeans_properties_programa
> tically
> 
> Gj
> 
> On 16-4-2017 9:39, Oliver Rettig wrote:
> > Hallo,
> > 
> > if you have the "Project"  you can locate the private.properties file and
> > you can access the file with plain java. This what I do in these cases. I
> > think there is no specific api to access this file. The problem is that
> > if you want to resolve templates/variables you have to do it on your own.
> > Some years ago i have tried to access programmatically project files via
> > ant but it looks to complex. If you find a better solution I am
> > interested in.
> > 
> > best regards
> > Oliver
> > 
> >> Hello.
> >> 
> >> I am newbie to programming plugins for netbeans and I can not solve one
> >> problem. Is it possible to read / edit standard project properties like
> >> remote connection or etc (Project -> Properties)?
> >> 
> >> I tried to use:
> >> 
> >> * ProjectUtils.getPreferences
> >> * NbProperties
> >> 
> >> But all this works only for modules...
> >> 
> >> I want to change what's in the file nbproject/private/private.properties
> >> 
> >> Help me, please.