This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Pages: 1 - Last Post: 17-Feb-2017 20:30 Last Post By: RobM
ctwist

Posts: 562
Registered: 27-Sep-2003
Copy files from the project res directory
Posted: 17-Feb-2017 17:55
 
  Click to reply to this thread Reply
Sometimes a project has some files that need to be copied to the output res directory. These files are "rootImageDirectory\res".
jAlbum does copy some of these files, but it doesn't copy everything. I use this snippet to copy all files. Can this be incorporated into jAlbum? Other skins may find it useful.
   // Copy all files from the project res directory to the output res directory. Don't copy the .jalbum folder.
    try
    {	IO.copyDirectoryContent(new File(rootImageDirectory, "res"), 
    													resDirectory,
    													true, 
    													new FileFilter()
    															{ public boolean accept(File pSrcFile)
    																{ return !pSrcFile.getName().equals(".jalbum");
    																}
    															}
    													);
		}
    catch(IOException e1)
    { throw new RuntimeException(e1);
    }
RobM

Posts: 3,234
Registered: 4-Aug-2006
Re: Copy files from the project res directory
Posted: 17-Feb-2017 18:19   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
I use that folder to store items I don't want copying to the root output's res folder, so the skin should be able to control copying or not.
ctwist

Posts: 562
Registered: 27-Sep-2003
Re: Copy files from the project res directory
Posted: 17-Feb-2017 18:22   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I didn't visualize that.

In that case, there is no point in pursuing this.
RobM

Posts: 3,234
Registered: 4-Aug-2006
Re: Copy files from the project res directory
Posted: 17-Feb-2017 19:07   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
I will have to revisit what I did as I can't remember offhand exactly what I did. What lies/folders do you use that aren't automatically copied as I would like to update the help documentation
JeffTucker

Posts: 6,897
Registered: 31-Jan-2006
Re: Copy files from the project res directory
Posted: 17-Feb-2017 19:17   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
My quick testing seems to indicate that everything from the project res directory is copied unless it matches the Ignore pattern. So, any file or folder that starts with a "dot" gets left behind. If my Ignore pattern also includes .txt files, for example, those also get left behind.

On top of that, file types that jAlbum doesn't recognize at all can't even be added to the res folder - try adding a .java file, for example.
ctwist

Posts: 562
Registered: 27-Sep-2003
Re: Copy files from the project res directory
Posted: 17-Feb-2017 19:38   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
A .js file was not copied. Maybe jAlbum assumes that is intended for album generation instead of for album viewing.

There is probably good reason for the current behaviour. It's probably not worth pursuing this.
JeffTucker

Posts: 6,897
Registered: 31-Jan-2006
Re: Copy files from the project res directory
Posted: 17-Feb-2017 19:46   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
A .js file was not copied.

Yeah, not listed in filetypes.xml, which sort of confirms my theory. Ditto for .css files.

It's not really that jAlbum refuses to copy them - you actually can't add them to res from within jAlbum. If you try to add them, jAlbum just ignores you!
RobM

Posts: 3,234
Registered: 4-Aug-2006
Re: Copy files from the project res directory
Posted: 17-Feb-2017 20:30   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Just to close, for future reference, it turns out that I do use all of the files added to the image directory's res folder. The issue I ran into was certain files added there were not surviving the album build, that is a file intended to replace one from the skin's res folder. I had to replace such files in finally.bsh instead of init.bsh.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums