Skip to main content

ContentServer does not send file name to ContentClient, JXSE 2.6 example

5 replies [Last post]
rylkov
Offline
Joined: 2004-06-09
Points: 0

I have found Content Management example in jxse-tutorials-2.6-project.zip and JXSE_ProgGuide_v2.6 (final).pdf. ContentClient.java and ContentServer.java are implemented to exchange files between peers. Unfortunately this example sends the contents of files only. It does not sends even file names. How to send file name with file content?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mcumings
Offline
Joined: 2004-04-22
Points: 0

Sorry for the delayed reply.

As you may have guessed, transfer of the file name is beyond the scope of the ContentService. This is for one very simple reason: While all files may be Content, not all Content need be a file. For example, what if the Content represented an in-memory record?

If you are interested in transferring files, you will need to add a layer of information and/or services around the ContentService to achieve your goal.

xiptos
Offline
Joined: 2005-02-23
Points: 0

I'm sorry for this naive question, but isn't the purpose of the Metadata class to convey information about the content it refers to?
Shouldn't it be possible to share the filename and other information about a FileContent this way?

Cheers,

mcumings
Offline
Joined: 2004-04-22
Points: 0

Yup! All the ContentService and related advertisements are extensible for that reason. The default API provides the mechanisms and the basics required to operate and allows the user of the API to layer in the additional information they may need. This allows the API to handle a much wider set of use cases.

xiptos
Offline
Joined: 2005-02-23
Points: 0

However, in SRDIContentShare as well as in DefaultContentShare, the advertisements are created as:
protected SRDISocketContentShareAdvertisementImpl
createContentShareAdvertisement() {
return new SRDISocketContentShareAdvertisementImpl();
}
and
@Override
protected DefaultContentShareAdvertisementImpl createContentShareAdvertisement() {
return new DefaultContentShareAdvertisementImpl();
}

So, it is not possible to extend the advertisement with a custom advertisement containing the file name. Is this correct?

Cheers,

/rp

rylkov
Offline
Joined: 2004-06-09
Points: 0

I will try to use JXTA Pipes to exchange file names, sizes, etc.