|
|
@@ -295,4 +295,61 @@ public class NullByteStreamResource extends Resource { |
|
|
|
</copy> |
|
|
|
</target> |
|
|
|
|
|
|
|
<!-- stolen from ../types/readwrite-test.xml - create a read-only file --> |
|
|
|
<property name="file" value="testfile"/> |
|
|
|
<condition property="unix"> |
|
|
|
<os family="unix"/> |
|
|
|
</condition> |
|
|
|
<target name="createTestdir"> |
|
|
|
<mkdir dir="${output}"/> |
|
|
|
<mkdir dir="${input}"/> |
|
|
|
<touch file="${output}/${file}"/> |
|
|
|
</target> |
|
|
|
<target name="makeFileUnwritable" |
|
|
|
depends="createTestdir,makeFileUnwritable-Unix,makeFileUnwritable-Windows"/> |
|
|
|
<target name="makeFileUnwritable-Unix" id="unix"> |
|
|
|
<chmod file="${output}/${file}" perm="444"/> |
|
|
|
</target> |
|
|
|
<target name="makeFileUnwritable-Windows" unless="unix"> |
|
|
|
<attrib file="${output}/${file}" readonly="true"/> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="XtestCopyOverReadOnlyFile" depends="makeFileUnwritable"> |
|
|
|
<sleep seconds="2"/> |
|
|
|
<touch file="${input}/${file}"/> |
|
|
|
<copy toDir="${output}"> |
|
|
|
<fileset dir="${input}"/> |
|
|
|
</copy> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilteredCopyOverReadOnlyFile" depends="makeFileUnwritable"> |
|
|
|
<sleep seconds="2"/> |
|
|
|
<touch file="${input}/${file}"/> |
|
|
|
<copy toDir="${output}"> |
|
|
|
<fileset dir="${input}"/> |
|
|
|
<filterset> |
|
|
|
<filter token="foo" value="bar"/> |
|
|
|
</filterset> |
|
|
|
</copy> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="XtestCopyOverReadOnlyFileWithOverwrite" |
|
|
|
depends="makeFileUnwritable"> |
|
|
|
<touch file="${input}/${file}"/> |
|
|
|
<copy toDir="${output}" overwrite="true"> |
|
|
|
<fileset dir="${input}"/> |
|
|
|
</copy> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilteredCopyOverReadOnlyFileWithOverwrite" |
|
|
|
depends="makeFileUnwritable"> |
|
|
|
<touch file="${input}/${file}"/> |
|
|
|
<copy toDir="${output}" overwrite="true"> |
|
|
|
<fileset dir="${input}"/> |
|
|
|
<filterset> |
|
|
|
<filter token="foo" value="bar"/> |
|
|
|
</filterset> |
|
|
|
</copy> |
|
|
|
</target> |
|
|
|
|
|
|
|
</project> |