FAQ

  1. How can I specify files to include and exclude using regular expressions?
  2. When using a JFS server, the log file tells me something about timeouts. What can I do?
  3. What to do, if Java reports too less memory?
  4. How to use JFS as part of synchronization scripts?
  5. Is it possible to change language and region settings?
  6. Can I change the look and feel?
  7. How to add translations to JFS?

How can I specify files to include and exclude using regular expressions?

In order to specify files or directories to include and/or exclude from comparison and synchronization, you have to specify a so called regular expression, which is matched with the names of files and directories.

Note that the regular expression is not matched with the complete path of a file or directory. For instance, if you have a file called C:\Documents\Test\Test.txt the expression will only be matched with Test.txt.

You may find an introduction to regular expressions in http://www.regular-expressions.info. The following list presents some typical examples for exclude and include patterns.

  1. .*\.bak will match all file names ending with .bak.
  2. .*My Music.* will match all file names including the words My Music.
  3. CVS will match all file names exactly matching the word CVS.

When using a JFS server, the log file tells me something about timeouts. What can I do?

When using a JFS server, the default timeout is set to 5 seconds. Using a slow connection to the JFS server (e.g., via modem) may cause a lot of timeouts during synchronization. Therefore, you should increase the timeout (via the JFS server properties) to at least a minute (3.600.000 ms) before starting synchronization.

What to do, if Java reports too less memory?

If you compare a lot of different files at once, it may happen that the Java virtual machine is out of memory. In this case, you should restart the program like:

java -Xmx256m -jar jfs.jar

The parameter -Xmx256 will increase the maximum heap size to 256 MB. You may also add this parameter to one of the starting scripts (e.g., JFileSync.bat for Windows systems).

How to use JFS as part of synchronization scripts?

JFS can be controlled via the command line. Normally, the JFS command line shell is started, when specifying the -nogui option. In this case, JFS performs an interactive synchronization via the shell; that is, you can have a look at the comparison table, specify synchronization modes, answer questions about files that may not be automatically synchronized, and so on. When using the -quiet option, every operation is performed in background without user interaction. This means that files that may not automatically be synchronized (e.g., because of an inconsistent time stamp) will be skipped during synchronization.

Assuming that you specified your directory pairs, synchronization mode, and other profile settings in file MyProfile.xml the JFS call as part of a synchronization script may look like follows:

java -jar jfs.jar -config MyProfile.xml -nogui -quiet

Is it possible to change language and region settings?

Yes, it is. By default JFS uses the system defaults of your user. If the selected language and region of your user is not English US, which is the only currently supported language and region, some dialog elements that are provided by the Java Swing User Interface will be displayed according to the chosen system language and region. This holds, for instance, for the file chooser dialogs or the display of time stamps. You may change this behavior by specifying some Java properties when the application is started.

If you want a special locale (language and region), like de_DE (German, Germany), you may call JFS as follows:

java -Duser.language=de -Duser.region=DE -jar jfs.jar

The parameter -Duser.language=de will set the used language for the Java virtual machine to de and the parameter -Duser.region=DE will set the used region to DE. You may also add this parameter to one of the starting scripts (e.g., JFileSync.bat for Windows systems).

Can I change the look and feel?

Yes, you can. By default the system look and feels are used for each Java platform. You may specify a specific look and feel, like JGoodies Plastic XP (see jgoodies.com), as follows:

java -cp lib\jfs.jar;lib\looks-1.3.jar jfs.JFileSync -laf com.jgoodies.looks.plastic.PlasticXPLookAndFeel

The Java parameter -cp lib\jfs.jar;lib\looks-1.3.jar specified the location of the JFS library and the JGoodies library containing the look and feel you want to use. The JFS parameter -laf com.jgoodies.looks.plastic.PlasticXPLookAndFeel specified the class in the JGoodies library that represents the look and feel you want to use.

Please note that the look and feel class specified by the -laf option is stored in the JFS configuration file (as part of the JFS configuration directory of your home directory). So, you only have to call JFS for the first time including the -laf option. After the first application start, you may use the following call in order to start JFS with the previously chosen look and feel:

java -cp lib\jfs.jar;lib\looks-1.3.jar jfs.JFileSync

You may also add this parameter to one of the starting scripts (e.g., JFileSync.bat for Windows systems).

How to add translations to JFS?

JFS has a quite simple internationalization mechanism. Let us assume, we want to add a German translation for JFS. You may add the new language for the command line and graphical user interface by following the following steps:

  1. Download the JFS development version.
  2. Copy file JFSTranslation.properties in directory src/jfs/resources/conf to JFSTranslations_de_DE.properties in order to get a template of all key words that have to be translated.
  3. Translate all values for all keys in the copied file.
  4. Call ant in order to create a new JFS build.
  5. Start JFS with the newly added language and region in order to check your translations: java -Duser.language=de -Duser.region=DE -jar lib/jfs.jar.

You may also add translations for the help files and command line help text files by following the following steps:

  1. Download the JFS development version.
  2. Copy file JFSConfig.properties in directory src/jfs/resources/conf to JFSConfig_de_DE.properties in order to get a copy of the main configuration for the locale (language and region) we want to add.
  3. Copy the file you want to translate from the directory src/jfs/resources to the same directory and add _de_DE to the file name (before the file extension), like: JFSFAQ_de_DE.html.
  4. Translate all text in the copied file.
  5. Change the keys of the file JFSConfig_de_DE.properties accordingly, so that the newly translated file is referenced, like HELP_FAQ = JFSFAQ_de_DE.html. The mechanism is quite general; you may even localize the used graphics.
  6. Call ant in order to create a new JFS build.
  7. Start JFS with the newly added language and region in order to check your translations: java -Duser.language=de -Duser.region=DE -jar lib/jfs.jar.