com.optrak.tools.repository
Interface NewEntry

All Known Implementing Classes:
ExistingEntry, NewResource

public interface NewEntry

Result of offering a new resource to a repository.


Method Summary
 boolean exists()
          Does the resource already exist in the repository?
 ResourceEntry getExistingEntry()
          existing entry details.
 java.lang.String getNewVersion()
          Version assigned to the new resource.
 ResourceEntry submit(java.io.File content)
          send the resource data.
 ResourceEntry submit(java.io.InputStream content, long length)
          send the resource data.
 

Method Detail

exists

boolean exists()
Does the resource already exist in the repository?

Returns:
true of the resource already exists.

getExistingEntry

ResourceEntry getExistingEntry()
existing entry details.

Returns:
existing entry if one exists otherwise null.

getNewVersion

java.lang.String getNewVersion()
Version assigned to the new resource. The RepositoryUpdater inserts this value in submitted JNLP files.

Returns:
assigned version.

submit

ResourceEntry submit(java.io.File content)
                     throws java.io.IOException
send the resource data. Equivalent to submit(new FileInputStream(content), content.length())

Parameters:
content - file to send.
Returns:
resulting entry in the repository
Throws:
java.io.IOException

submit

ResourceEntry submit(java.io.InputStream content,
                     long length)
                     throws java.io.IOException
send the resource data. If two or more processes (users) submit the same resource at the same time, the first will succeed, and the others will get the entry resulting from that successful submission. Do NOT assume that the entry returned has the path that you expect to submit --- if someone else gets there first with a different path that is the one which wins.

Parameters:
content - stream containing resource content
length - length of the stream in bytes
Returns:
resulting entry in the repository
Throws:
java.io.IOException