Link to home
Start Free TrialLog in
Avatar of Drop_of_Rain
Drop_of_Rain

asked on

I have the files How do I get them into ListOfFiles?

I have this code to create a list of files. I have the files How do I get them into ListOfFiles? I have some ideas but I will wait for more experience to make some suggestions. Can you show me in code please.



ListOfFiles mylist = new ListOfFiles(args);
List streams = new ArrayList();
while (mylist.hasMoreElements())
{
   InputStream in = (InputStream) mylist.nextElement();
   streams.add(AudioSystem.getAudioInputStream(in));
}
SequenceInputStream s = new SequenceInputStream(format, streams);
Avatar of zzynx
zzynx
Flag of Belgium image

Don't know exactly what you mean.
What is ListOfFiles? Your own type? Is it a List?

A List can contain any objects.
A File is an object.
So a List can contain Files.
Avatar of Drop_of_Rain
Drop_of_Rain

ASKER

ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, so what's the problem?
>> Yes, so what's the problem?
?????
You say "yes" to what question?
Your code was not there when I typed that ;-)

I wanted to hear some more details from Drop_of_rain.
I want to try the Enumeration process. I have to resolve this because this is a big part of my program. I made up some sample files to test it. I needed to be able to get the files into ListOfFiles because that is what Enumeration expects. ListOfFiles took its arguments from the command line. The code above was created to create that same list from an arraylist.

I think you have resolved this for me. I will wait for mayankeagle comments before I close.

Thanks
Christopher
Well, if you're satisfied with zzynx's comments, then go ahead and close it :-)

Actually, yes, you do need an add () method to add the items.
>> I think you have resolved this for me.
Glad to hear that.

>> I will wait for mayankeagle comments before I close.
OK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks you guys. I increased the points by 100 to give mmuruganandam some for his suggestion