RES: Copying a file but getting a directory

"Alexandre Da Silva Duarte" <[email protected]>
Newsgroups gmane.comp.jakarta.slide.user
Message-ID <[email protected]>
Jeroen,

	First, thanks for your reply :-)
	I have tried the copyMethod(source, destination), and got the
same behavior. I have tried connecting with Windows XP, and when I do
the Ctrl C + Ctrl V I got the same behavior.

	I put the line below (the XXXX one) in ContentImpl.java and it's
working now:

// We update the descriptor's properties
NodeRevisionDescriptor oldRevisionDescriptor =
    objectUri.getStore()
    .retrieveRevisionDescriptor
    (objectUri, newRevisionNumber);
Enumeration newPropertiesList =
    revisionDescriptor.enumerateProperties();
while (newPropertiesList.hasMoreElements()) {
    oldRevisionDescriptor
        .setProperty((NodeProperty) newPropertiesList
                         .nextElement() );
}

// XXXX the resourcetype property is lost, so I have to set it again....
// XXXX is it a bug or a bad configuration ???
oldRevisionDescriptor.setResourceType(revisionDescriptor.getResourceType
());

// now use the merged revision descriptor
revisionDescriptor = oldRevisionDescriptor;


	The revisionDescriptor's resourcetype property has the value "",
but the oldRevisionDescriptor's resourcetype property has the value
"<collection/>" (it's the default value for NodeRevisionDescriptor).
Thus, the oldRevisionDescriptor's properties overwrite the
revisionDescriptor's properties, and the correct resourcetype is lost. I
can't say if it's a bug or a wrong configuration that I have done...

Alexandre

-----Mensagem original-----
De: Jeroen Reijn [mailto:[email protected]] 
Enviada em: segunda-feira, 11 de setembro de 2006 10:44
Para: Slide Users Mailing List
Assunto: RE: Copying a file but getting a directory

Hi Alexandre,

i'm not really familiar yet with the slide API, 

what happens if you use the copyMethod with source and destination

res.copyMethod("/slide/files/directoryX/fileA.rtf","/slide/files/directo
ryY/fileA.rtf");

Could it have something to do with that the path of the copy method is
relative?

Regards,

Jeroen Reijn
Hippo



-----Original Message-----
From: Alexandre Da Silva Duarte [mailto:[email protected]]
Sent: maandag 11 september 2006 15:25
To: [email protected]
Subject: Copying a file but getting a directory


Hi,

	I am running WCK and I am getting a strange behavior with the
copyMethod/moveMethod:

// just copying a file to another directory
res.setPath("/slide/files/directoryX/fileA.rtf");
boolean result = res.copyMethod("/slide/files/directoryY/fileA.rtf");

	But at the end of this execution I got a directory called
"fileA.rtf" instead a file.
	Someone knows what am I doing wrong?

Thanks in advance

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.