I am just getting into Java, so I am still learning methodologies.
My current project is to automate publishing documents that come from
another system. Everyday there would be .txt and .pdf files copied to
a folder. I would be publishing this files to a CMS using an
third-party SDK. The files coming in would always be the same name
aside from a date in the filename. The files would need to be
specified to be published to different folders, IE:
file1_20051115.txt ===> folder1
file2_20051115.pdf ===> folder1
file3_20051115.txt ===> folder2
The destination folder would always be the same for each corresponding
file. My question is, should I use an array with all the file names
and its corresponding folder names? or should I use a properties file?
Thanks in advance.
In a previous article, sampsonyee@gmail.com said:
>The destination folder would always be the same for each corresponding
>file. My question is, should I use an array with all the file names
>and its corresponding folder names? or should I use a properties file?
Can you foresee adding file names in the future? Or changing the mapping?
If there is even the slightest possibility of that, don't you think it
would be better to NOT have to recompile the program to make that change?
On the other hand, having a file with the mapping means that anybody with
write access to the file can change the mapping. That may or may not be a
good thing, depending on your circumstances.

Signature
Paul Tomblin <ptomblin@xcski.com> http://xcski.com/blogs/pt/
I assume HR did send out the ad I wanted, not "apply for a cool job if
you're a clueless f.ck".
-- The Flying Hamster, on the receiving end of too many CVs
Robert Klemme - 15 Nov 2005 15:33 GMT
> In a previous article, sampsonyee@gmail.com said:
>> The destination folder would always be the same for each
[quoted text clipped - 10 lines]
> with write access to the file can change the mapping. That may or
> may not be a good thing, depending on your circumstances.
You should also consider the application's architecture and deployment.
Is it GUI based? Is it a demon or batch run? Will you add more
configuration options in the future? Are they complex? ...
robert
>file1_20051115.txt ===> folder1
>file2_20051115.pdf ===> folder1
[quoted text clipped - 3 lines]
>file. My question is, should I use an array with all the file names
>and its corresponding folder names? or should I use a properties file?
sounds to me like you have an algorithm. Just use that to determine
the destination folder.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.