Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

copy xsl file

Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi My friends,
How can I modify the following to copy any file endWith xsl on the desktop in stead of only copying data.xsl?
Your explanation is greatly appreciated.
import java.lang.*;
public class cfXSL {
public static void main(String[] args) {
try {
File inputFile = new
String [] filenames = inputFile.list ();
File outputFile = new
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
for (int i=0; i<filenames.length; i++)
if (filenames [i].endsWith (".xsl"))
LineNumberReader lnr = new LineNumberReader(in);
String s;
while ( (s = lnr.readLine()) != null ) {
System.out.println(lnr.getLineNumber() + "==> " + s );
catch (IOException ie) { System.out.println("input/output error"); }
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same question to more than one forum. This thread is now closed. All replies to the one in "IO and streams", please.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic