ruper2/src/java/core/org/krysalis/ruper2/resource Resource.java,1.1,1.2

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/resource
In directory sc8-pr-cvs1:/tmp/cvs-serv25526/src/java/core/org/krysalis/ruper2/resource

Modified Files:
	Resource.java 
Log Message:
1) Copied over Ruper1 documentation to work on
2) Worked on RepositoryTool [command line] to list groups/resoruces
3) Ignore .* files, and associate .MD5 w/ original. [Later check hash]

Index: Resource.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/resource/Resource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Resource.java	29 Sep 2003 18:09:19 -0000	1.1
--- Resource.java	1 Oct 2003 21:55:56 -0000	1.2
***************
*** 55,58 ****
--- 55,59 ----
  		Version version,
  		ResourceType type,
+ 		String extension,
  		String filename,
  		VirtualResourceLocator location) {
***************
*** 62,65 ****
--- 63,68 ----
  		m_type = type;
  
+ 		m_extension = extension;
+ 
  		m_filename = filename;
  		m_location = location;
***************
*** 77,80 ****
--- 80,85 ----
  		m_type = other.m_type;
  
+ 		m_extension = other.m_extension;
+ 
  		m_filename = other.m_filename;
  		m_location = other.m_location;
***************
*** 93,96 ****
--- 98,103 ----
  		m_group = new ResourceGroup(identifier.getId());
  
+ 		// :TODO: Type and Extension?
+ 
  		m_filename = filename;
  		m_location = location;
***************
*** 159,162 ****
--- 166,179 ----
  			equal &= otherResource.m_type.equals(m_type);
  
+ 			if (null == m_extension)
+ 				equal &= (null == otherResource.m_extension);
+ 			else
+ 				equal &= otherResource.m_extension.equals(m_extension);
+ 
+ 			if (null == m_version)
+ 				equal &= (null == otherResource.m_version);
+ 			else
+ 				equal &= otherResource.m_version.equals(m_version);
+ 
  			//:TODO: Same for version and ... ???
  		}
***************
*** 177,184 ****
  		hash += m_identifier.hashCode();
  		hash += m_type.hashCode();
  
! 		//:TODO: Optional ones..
  
! 		return super.hashCode();
  	}
  
--- 194,204 ----
  		hash += m_identifier.hashCode();
  		hash += m_type.hashCode();
+ 		if (null != m_extension)
+ 			hash += m_extension.hashCode();
  
! 		if (null != m_version)
! 			hash += m_version.hashCode();
  
! 		return hash;
  	}
  
***************
*** 207,210 ****
--- 227,233 ----
  
  		out.print(indent);
+ 		out.println("Resource Extension: " + m_extension);
+ 
+ 		out.print(indent);
  		out.println("Resource Location: " + m_location);
  
***************
*** 227,230 ****
--- 250,294 ----
  		m_location = locator;
  	}
+ 	/**
+ 	 * @param string
+ 	 */
+ 	public void setExtension(String string) {
+ 		m_extension = string;
+ 	}
+ 
+ 	/**
+ 	 * @param string
+ 	 */
+ 	public void setFilename(String string) {
+ 		m_filename = string;
+ 	}
+ 
+ 	/**
+ 	 * @param group
+ 	 */
+ 	public void setGroup(ResourceGroup group) {
+ 		m_group = group;
+ 	}
+ 
+ 	/**
+ 	 * @param identifier
+ 	 */
+ 	public void setIdentifier(ResourceIdentifier identifier) {
+ 		m_identifier = identifier;
+ 	}
+ 
+ 	/**
+ 	 * @param type
+ 	 */
+ 	public void setType(ResourceType type) {
+ 		m_type = type;
+ 	}
+ 
+ 	/**
+ 	 * @param version
+ 	 */
+ 	public void setVersion(Version version) {
+ 		m_version = version;
+ 	}
  
  	public static List getTestResourceList(String group, int count) {
***************
*** 267,276 ****
--- 331,350 ----
  		Version version,
  		ResourceType type) {
+ 		return getTestResource(name, version, type, ".test");
+ 	}
+ 
+ 	public static Resource getTestResource(
+ 		String name,
+ 		Version version,
+ 		ResourceType type,
+ 		String extension) {
  		return new Resource(
  			name,
  			version,
  			type,
+ 			extension,
  			name,
  			new VirtualResourceLocator("http://somewhere/" + name));
  	}
+ 
  }




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.