Help using getAllExistingTags method
"Rick T." <[email protected]> Sun, 4 Jun 2006 23:43:39 -0300
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Message-ID | <000b01c68849$db2d5850$9700a8c0@Main> |
------=_NextPart_000_0008_01C68830.B43ECC60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sorry if it is a newbie question but im not being able to solve this... =
Im trying to get all the Tags from a specific File but the LIST is =
always empty. The file have 4 Tags in different revisions. The code =
follows:
public void CVS(){
cvsroot =3D =
":pserver:"+userName+":"+encodedPassword+"@"+hostName+":"+repository;
txt_Status.setText("Conectando ao CVS...");
try{
CVSRoot cvs =3D CVSRoot.parse(cvsroot);
c =3D new PServerConnection(cvs);
c.open();
globalOptions.setCVSRoot(cvsroot);
client =3D new Client(c, new StandardAdminHandler());
client.setLocalPath(localPath);
=20
client.getEventManager().addCVSListener(new CVSAdapter()
{
=20
public void fileInfoGenerated(FileInfoEvent fie)
{
StatusInformation info =3D (StatusInformation) =
fie.getInfoContainer();
lista =3D info.getAllExistingTags();
}
} );
}catch (AuthenticationException ae){
ae.printStackTrace();
}catch (CommandAbortedException cae){
cae.printStackTrace();
}catch (NullPointerException ne){
ne.printStackTrace();
}
File[] f =3D new File[1];
f[0] =3D new File( localPath+"Dunha.sql" );
StatusCommand command =3D new StatusCommand();
command.setIncludeTags(true);
command.setFiles( f );
command.setBuilder(new StatusBuilder(client.getEventManager(), =
command));
try {
client.executeCommand( command, globalOptions );
} catch (CommandException ex) {
ex.printStackTrace();
} catch (AuthenticationException ex) {
ex.printStackTrace();
}
=20
for (Iterator it =3D lista.iterator(); it.hasNext();){
StatusInformation.SymName tag =3D (SymName) it.next();
txt_Status.setText(txt_Status.getText()+"\n"+tag.getTag());
}
} =20
=20
Thanks in advance
Ricardo
------=_NextPart_000_0008_01C68830.B43ECC60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Sorry if it is a newbie question but im =
not being=20
able to solve this... Im trying to get all the Tags from a specific File =
but the=20
LIST is always empty. The file have 4 Tags in different revisions. The =
code=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> public void=20
CVS(){<BR> cvsroot =3D=20
":pserver:"+userName+":"+encodedPassword+"@"+hostName+":"+repository;<BR>=
=20
txt_Status.setText("Conectando ao=20
CVS...");<BR> =20
try{<BR>  =
; =20
CVSRoot cvs =3D=20
CVSRoot.parse(cvsroot);<BR> &nbs=
p; =20
c =3D new=20
PServerConnection(cvs);<BR> &nbs=
p; =20
c.open();<BR> =
=20
globalOptions.setCVSRoot(cvsroot);<BR>  =
; =20
client =3D new Client(c, new=20
StandardAdminHandler());<BR> &nb=
sp; =20
client.setLocalPath(localPath);<BR> &n=
bsp; =20
<BR> &nb=
sp; =20
client.getEventManager().addCVSListener(new=20
CVSAdapter()<BR> &nb=
sp; =20
{<BR> =20
<BR> &nb=
sp; =20
public void fileInfoGenerated(FileInfoEvent=20
fie)<BR>  =
; =20
{<BR> &n=
bsp; =20
StatusInformation info =3D (StatusInformation)=20
fie.getInfoContainer();<BR> &nbs=
p; =20
<STRONG>lista =3D=20
info.getAllExistingTags();<BR></STRONG> &nbs=
p; =20
}<BR> =
}=20
);<BR> =
}catch=20
(AuthenticationException=20
ae){<BR>  =
; =20
ae.printStackTrace();<BR> =
=20
}catch (CommandAbortedException=20
cae){<BR> &nbs=
p; =20
cae.printStackTrace();<BR>  =
; =20
}catch (NullPointerException=20
ne){<BR>  =
; =20
ne.printStackTrace();<BR> =
=20
}</FONT></DIV><FONT face=3DArial size=3D2>
<DIV><BR> File[] f =3D new=20
File[1];<BR> f[0] =3D new =
File(=20
localPath+"Dunha.sql" );<BR> =20
StatusCommand command =3D new=20
StatusCommand();<BR> =20
command.setIncludeTags(true);<BR> &nbs=
p;=20
command.setFiles( f );<BR> =20
command.setBuilder(new StatusBuilder(client.getEventManager(),=20
command));<BR> try=20
{<BR> =20
client.executeCommand( command, globalOptions=20
);<BR> } catch =
(CommandException ex)=20
{<BR> =20
ex.printStackTrace();<BR> } =
catch=20
(AuthenticationException ex)=20
{<BR> =20
ex.printStackTrace();<BR> =20
}<BR> <BR><STRONG> &n=
bsp; =20
for (Iterator it =3D lista.iterator();=20
it.hasNext();){<BR> =
=20
StatusInformation.SymName tag =3D (SymName)=20
it.next();<BR>  =
; =20
txt_Status.setText(txt_Status.getText()+"\n"+tag.getTag());<BR> &nbs=
p; =20
}</STRONG><BR>} =20
<BR> </DIV>
<DIV> </DIV>
<DIV>Thanks in advance</DIV>
<DIV> </DIV>
<DIV>Ricardo</FONT></DIV></BODY></HTML>
------=_NextPart_000_0008_01C68830.B43ECC60--