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

« back to all changes in this revision

Viewing changes to src/freeguide/plugins/importexport/xmltv/ImpExpXmltv.java

  • Committer: Bazaar Package Importer
  • Author(s): Shaun Jackman
  • Date: 2007-09-11 16:52:59 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070911165259-4r32oke21i1ezbmv
Tags: 0.10.5-1
* New upstream release.
* Update the watch file.
* Change Debian policy to version 3.7.2.2. No changes necessary.
* Add ant-optional to build dependencies. Closes: #441762.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import freeguide.common.gui.FileChooserExtension;
4
4
 
5
5
import freeguide.common.lib.fgspecific.data.TVData;
 
6
import freeguide.common.lib.general.StringHelper;
6
7
import freeguide.common.lib.importexport.XMLTVExport;
7
8
import freeguide.common.lib.importexport.XMLTVImport;
8
9
 
30
31
public class ImpExpXmltv extends BaseModule implements IModuleImport,
31
32
    IModuleExport
32
33
{
 
34
    protected static final String EXT_XMLTV = ".xmltv";
 
35
 
33
36
    /**
34
37
     * DOCUMENT_ME!
35
38
     *
54
57
            {
55
58
                public String getDescription(  )
56
59
                {
57
 
                    return "XMLTV .xmltv file";
 
60
                    return i18n.getString( "Format.xmltv" );
58
61
                }
59
62
 
60
63
                public boolean accept( File pathname )
61
64
                {
62
65
                    return pathname.isDirectory(  )
63
 
                    || pathname.getName(  ).endsWith( ".xmltv" );
 
66
                    || pathname.getName(  ).endsWith( EXT_XMLTV );
64
67
                }
65
68
            } );
66
69
        chooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
82
85
                        {
83
86
                            imp.process( 
84
87
                                files[i], storage, null,
85
 
                                new XMLTVImport.Filter(  ), "" );
 
88
                                new XMLTVImport.Filter(  ),
 
89
                                StringHelper.EMPTY_STRING );
86
90
                        }
87
91
                        catch( IOException e )
88
92
                        {
114
118
        throws Exception
115
119
    {
116
120
        new XMLTVImport(  ).process( 
117
 
            file, storage, null, new XMLTVImport.Filter(  ), "" );
 
121
            file, storage, null, new XMLTVImport.Filter(  ),
 
122
            StringHelper.EMPTY_STRING );
118
123
    }
119
124
 
120
125
    /**
134
139
            {
135
140
                public String getDescription(  )
136
141
                {
137
 
                    return "XMLTV .xmltv file";
 
142
                    return i18n.getString( "Format.xmltv" );
138
143
                }
139
144
 
140
145
                public boolean accept( File pathname )
141
146
                {
142
147
                    return pathname.isDirectory(  )
143
 
                    || pathname.getName(  ).endsWith( ".xmltv" );
 
148
                    || pathname.getName(  ).endsWith( EXT_XMLTV );
144
149
                }
145
150
            } );
146
151
        chooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
152
157
        {
153
158
            File destination = chooser.getSelectedFile(  );
154
159
 
155
 
            if( !destination.getPath(  ).endsWith( ".xmltv" ) )
 
160
            if( !destination.getPath(  ).endsWith( EXT_XMLTV ) )
156
161
            {
157
 
                destination = new File( destination.getPath(  ) + ".xmltv" );
 
162
                destination = new File( destination.getPath(  ) + EXT_XMLTV );
158
163
            }
159
164
 
160
165
            destination.delete(  );