~ubuntu-branches/ubuntu/trusty/freeguide/trusty

« back to all changes in this revision

Viewing changes to src/freeguide/plugins/program/freeguide/migration/Migrate0_10_7To0_10_8.java

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Watkins
  • Date: 2008-09-07 15:49:32 UTC
  • mfrom: (1.2.6 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080907154932-2jvgv76btq068fe0
Tags: 0.10.9-1
* New upstream release. (Closes: #492789)
* Moved package from contrib to main. (Closes: #492544)
* Added lintian override for 'build-depends-without-arch-dep ant', as ant is
  used in the clean target.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package freeguide.plugins.program.freeguide.migration;
 
2
 
 
3
import freeguide.common.lib.general.FileHelper;
 
4
 
 
5
import freeguide.plugins.program.freeguide.FreeGuide;
 
6
 
 
7
import java.io.File;
 
8
 
 
9
import java.util.prefs.BackingStoreException;
 
10
 
 
11
/**
 
12
 * DOCUMENT ME!
 
13
 *
 
14
 * @author $author$
 
15
 * @version $Revision$
 
16
 */
 
17
public class Migrate0_10_7To0_10_8 extends MigrationProcessBase
 
18
{
 
19
/**
 
20
     * Creates a new Migrate0_10_7To0_10_8 object.
 
21
     *
 
22
     * @param nodeName DOCUMENT ME!
 
23
     *
 
24
     * @throws BackingStoreException DOCUMENT ME!
 
25
     */
 
26
    public Migrate0_10_7To0_10_8( final String nodeName )
 
27
        throws BackingStoreException
 
28
    {
 
29
        super( nodeName );
 
30
    }
 
31
 
 
32
    /**
 
33
     * DOCUMENT_ME!
 
34
     *
 
35
     * @throws Exception DOCUMENT_ME!
 
36
     */
 
37
    public void migrate(  ) throws Exception
 
38
    {
 
39
        FreeGuide.log.info( "Upgrading preferences 0.10.7 -> 0.10.8" );
 
40
 
 
41
        boolean isWindows =
 
42
            System.getProperty( "os.name" ).startsWith( "Windows" );
 
43
 
 
44
        // Delete the installed XMLTV version so we can unzip a newer one
 
45
        if( isWindows )
 
46
        {
 
47
            final File xmltvDir =
 
48
                new File( FreeGuide.config.workingDirectory, "xmltv" );
 
49
 
 
50
            FileHelper.deleteDir( xmltvDir );
 
51
        }
 
52
 
 
53
        moveNode( "" );
 
54
 
 
55
        getAndRemoveKey( "version" );
 
56
        putKey( "version", "0.10.8" );
 
57
    }
 
58
}
 
59