git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@413537 13f79535-47bb-0310-9956-ffa450edef68master
@@ -97,6 +97,20 @@ public class PropertyResource extends Resource { | |||||
return super.hashCode() * PROPERTY_MAGIC; | return super.hashCode() * PROPERTY_MAGIC; | ||||
} | } | ||||
/** | |||||
* Get the string. | |||||
* | |||||
* @return the string contents of the resource. | |||||
* @since Ant 1.7 | |||||
*/ | |||||
public String toString() { | |||||
if (isReference()) { | |||||
return getCheckedRef().toString(); | |||||
} | |||||
return getName()!=null?("${"+getName()+"}") | |||||
:"null"; | |||||
} | |||||
/** | /** | ||||
* Get an InputStream for the Resource. | * Get an InputStream for the Resource. | ||||
* @return an InputStream containing this Resource's content. | * @return an InputStream containing this Resource's content. | ||||
@@ -127,6 +127,19 @@ public class StringResource extends Resource { | |||||
return super.hashCode() * STRING_MAGIC; | return super.hashCode() * STRING_MAGIC; | ||||
} | } | ||||
/** | |||||
* Get the string. | |||||
* | |||||
* @return the string contents of the resource. | |||||
* @since Ant 1.7 | |||||
*/ | |||||
public String toString() { | |||||
if (isReference()) { | |||||
return getCheckedRef().toString(); | |||||
} | |||||
return String.valueOf(getContent()); | |||||
} | |||||
/** | /** | ||||
* Get an InputStream for the Resource. | * Get an InputStream for the Resource. | ||||
* @return an InputStream containing this Resource's content. | * @return an InputStream containing this Resource's content. | ||||