View | Details | Raw Unified | Return to bug 283033
Collapse All | Expand All

(-)src/org/eclipse/rse/internal/files/ui/FileResources.properties (+4 lines)
Lines 25-30 Link Here
25
# David Dykstal (IBM) [231841] Correcting messages for folder creation
25
# David Dykstal (IBM) [231841] Correcting messages for folder creation
26
# Kevin Doyle		(IBM)		- [242389] [usability] RSE Save Conflict dialog should indicate which file is in conflict
26
# Kevin Doyle		(IBM)		- [242389] [usability] RSE Save Conflict dialog should indicate which file is in conflict
27
# David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
27
# David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
28
# David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
28
###############################################################################
29
###############################################################################
29
30
30
# NLS_MESSAGEFORMAT_VAR
31
# NLS_MESSAGEFORMAT_VAR
Lines 107-112 Link Here
107
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL=Text
108
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL=Text
108
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_TOOLTIP=Transfer as text file
109
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_TOOLTIP=Transfer as text file
109
110
111
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL=XML
112
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_TOOLTIP=Transfer as XML file
113
110
RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_LABEL=Default File Transfer Mode
114
RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_LABEL=Default File Transfer Mode
111
RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_TOOLTIP=Default mode of file transfer for unspecified file types
115
RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_TOOLTIP=Default mode of file transfer for unspecified file types
112
116
(-)src/org/eclipse/rse/internal/files/ui/FileResources.java (+4 lines)
Lines 23-28 Link Here
23
 * Rupen Mardirossian (IBM)		 - [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder.
23
 * Rupen Mardirossian (IBM)		 - [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder.
24
 * David Dykstal (IBM) [231841] Correcting messages for folder creation
24
 * David Dykstal (IBM) [231841] Correcting messages for folder creation
25
 * David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
25
 * David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
26
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
26
 *******************************************************************************/
27
 *******************************************************************************/
27
28
28
package org.eclipse.rse.internal.files.ui;
29
package org.eclipse.rse.internal.files.ui;
Lines 110-115 Link Here
110
111
111
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL;
112
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL;
112
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_TOOLTIP;
113
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_TOOLTIP;
114
	
115
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL;
116
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_TOOLTIP;
113
117
114
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_LABEL;
118
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_LABEL;
115
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_TOOLTIP;
119
	public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_DEFAULT_MODE_TOOLTIP;
(-)src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java (-12 / +31 lines)
Lines 21-26 Link Here
21
 * David McKnight   (IBM)        - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
21
 * David McKnight   (IBM)        - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
22
 * David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
22
 * David McKnight   (IBM)        - [223204] [cleanup] fix broken nls strings in files.ui and others
23
 * David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
23
 * David McKnight   (IBM)        - [245260] Different user's connections on a single host are mapped to the same temp files cache
24
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
24
 *******************************************************************************/
25
 *******************************************************************************/
25
26
26
package org.eclipse.rse.internal.files.ui.propertypages;
27
package org.eclipse.rse.internal.files.ui.propertypages;
Lines 475-483 Link Here
475
		
476
		
476
		
477
		
477
	
478
	
478
		String[] contentTypes = new String[2];
479
		String[] contentTypes = new String[3];
479
		contentTypes[0] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL;
480
		contentTypes[0] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL;
480
		contentTypes[1] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL;
481
		contentTypes[1] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL;
482
		contentTypes[2] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL;
481
		
483
		
482
	    CellEditor editors[] = new CellEditor[3];
484
	    CellEditor editors[] = new CellEditor[3];
483
	    editors[0] = null;
485
	    editors[0] = null;
Lines 617-624 Link Here
617
			binaryFileImage = applyBinaryDecoration(fileImage);
619
			binaryFileImage = applyBinaryDecoration(fileImage);
618
		}
620
		}
619
		
621
		
622
		
620
		// for now just always using the same image
623
		// for now just always using the same image
621
		if (mapping.isBinary())
624
		if (mapping.isBinary() || mapping.isXML())
622
		{
625
		{
623
			return binaryFileImage;
626
			return binaryFileImage;
624
		}
627
		}
Lines 645-653 Link Here
645
		item.setImage(0, image);
648
		item.setImage(0, image);
646
		item.setText(1, mapping.getLabel());
649
		item.setText(1, mapping.getLabel());
647
		
650
		
648
		boolean binary = mapping.isBinary();
651
		
649
		item.setText(2, binary ? FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL : FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL);
652
		boolean isText = mapping.isText();
650
				
653
		boolean isXML = mapping.isXML();
654
655
		if (isText){
656
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL);
657
		}
658
		else if (isXML){
659
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL);
660
		}
661
		else {
662
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
663
		}	
651
		
664
		
652
		if (selected)
665
		if (selected)
653
			resourceTypeTable.setSelection(index);
666
			resourceTypeTable.setSelection(index);
Lines 748-753 Link Here
748
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
761
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
749
			item.setImage(getImageFor(mapping));
762
			item.setImage(getImageFor(mapping));
750
		}
763
		}
764
		else if (mapping.isXML()){
765
			mapping.setAsXML();
766
			item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL);
767
			item.setImage(getImageFor(mapping));			
768
		}
751
	}
769
	}
752
	
770
	
753
	/**
771
	/**
Lines 1060-1077 Link Here
1060
				if (value instanceof Integer)
1078
				if (value instanceof Integer)
1061
				{
1079
				{
1062
					int index = ((Integer)value).intValue();
1080
					int index = ((Integer)value).intValue();
1063
					if (index == 0)
1081
					if (index == 0) {
1064
					{
1065
						mapping.setAsBinary();
1082
						mapping.setAsBinary();
1066
						item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
1083
						item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
1067
						item.setImage(getImageFor(mapping));
1068
					}
1084
					}
1069
					else
1085
					else if (index == 1){
1070
					{
1071
						mapping.setAsText();
1086
						mapping.setAsText();
1072
						item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL);
1087
						item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL);						
1073
						item.setImage(getImageFor(mapping));
1088
					}
1089
					else if (index == 2){					
1090
						mapping.setAsXML();
1091
						item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_XML_LABEL);						
1074
					}
1092
					}
1093
					item.setImage(getImageFor(mapping));
1075
				}
1094
				}
1076
				
1095
				
1077
			}
1096
			}
(-)plugin.xml (-2 / +3 lines)
Lines 13-18 Link Here
13
    
13
    
14
    Contributors:
14
    Contributors:
15
    Anna Dushistova (MontaVista) - [227535] Avoid dependency on files.core
15
    Anna Dushistova (MontaVista) - [227535] Avoid dependency on files.core
16
    David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
16
 -->
17
 -->
17
18
18
<plugin>
19
<plugin>
Lines 55-62 Link Here
55
  <remoteFileTypes extension="tif" type="binary"/>
56
  <remoteFileTypes extension="tif" type="binary"/>
56
  <remoteFileTypes extension="txt" type="text"/>
57
  <remoteFileTypes extension="txt" type="text"/>
57
  <remoteFileTypes extension="xls" type="binary"/>
58
  <remoteFileTypes extension="xls" type="binary"/>
58
  <remoteFileTypes extension="xmi" type="binary"/>
59
  <remoteFileTypes extension="xmi" type="xml"/>
59
  <remoteFileTypes extension="xml" type="binary"/>
60
  <remoteFileTypes extension="xml" type="xml"/>
60
  <remoteFileTypes extension="zip" type="binary"/>
61
  <remoteFileTypes extension="zip" type="binary"/>
61
62
62
</extension>
63
</extension>
(-)src/org/eclipse/rse/subsystems/files/core/model/RemoteFileUtility.java (-1 / +2 lines)
Lines 15-20 Link Here
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
16
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
16
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
17
 * David McKnight   (IBM)        - [267247] Wrong encoding - new method to get source encoding for IFile
17
 * David McKnight   (IBM)        - [267247] Wrong encoding - new method to get source encoding for IFile
18
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
18
 ********************************************************************************/
19
 ********************************************************************************/
19
20
20
package org.eclipse.rse.subsystems.files.core.model;
21
package org.eclipse.rse.subsystems.files.core.model;
Lines 49-55 Link Here
49
	 * for this particular file, then the default charset is used.  If an exception
50
	 * for this particular file, then the default charset is used.  If an exception
50
	 * is hit trying to get the encoding, then the fallback is UTF-8
51
	 * is hit trying to get the encoding, then the fallback is UTF-8
51
	 * 
52
	 * 
52
	 * @since 3.1
53
	 * @since 4.0
53
	 */
54
	 */
54
	public static String getSourceEncoding(IFile file)
55
	public static String getSourceEncoding(IFile file)
55
	{
56
	{
(-)src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeMapping.java (-3 / +21 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2008 IBM Corporation and others.
2
 * Copyright (c) 2002, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-27 Link Here
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * David McKnight   (IBM)        - [208951] new priority field
15
 * David McKnight   (IBM)        - [208951] new priority field
16
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
16
 *******************************************************************************/
17
 *******************************************************************************/
17
18
18
package org.eclipse.rse.subsystems.files.core.model;
19
package org.eclipse.rse.subsystems.files.core.model;
19
20
20
public interface ISystemFileTransferModeMapping {
21
public interface ISystemFileTransferModeMapping {
21
22
22
23
24
	/**
23
	/**
24
	 * @since 3.2
25
	 */
26
	public static final int FILE_TYPE_BINARY = 0;
27
	/**
28
	 * @since 3.2
29
	 */
30
	public static final int FILE_TYPE_TEXT = 1;
31
	/**
32
	 * @since 3.2
33
	 */
34
	public static final int FILE_TYPE_XML = 2;
35
36
	/** 
25
	 * Get the extension
37
	 * Get the extension
26
	 * 
38
	 * 
27
	 * @return the extension for the mapping
39
	 * @return the extension for the mapping
Lines 60-65 Link Here
60
	 */
72
	 */
61
	public boolean isText();
73
	public boolean isText();
62
	
74
	
75
	/**
76
	 * Returns if the mapping is XML
77
	 * 
78
	 * @return true if XML
79
	 */
80
	public boolean isXML();
63
	
81
	
64
	/**
82
	/**
65
	 * Gets the priority - the smaller the number, the higher priority
83
	 * Gets the priority - the smaller the number, the higher priority
(-)src/org/eclipse/rse/subsystems/files/core/model/ISystemFileTransferModeRegistry.java (-1 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 14-19 Link Here
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * {Name} (company) - description of contribution.
16
 * David McKnight    (IBM) - [208951] Don't use hard-coded file type defaults
16
 * David McKnight    (IBM) - [208951] Don't use hard-coded file type defaults
17
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
17
 *******************************************************************************/
18
 *******************************************************************************/
18
19
19
package org.eclipse.rse.subsystems.files.core.model;
20
package org.eclipse.rse.subsystems.files.core.model;
Lines 40-43 Link Here
40
	// Query whether a file should be treated as text
41
	// Query whether a file should be treated as text
41
	public boolean isText(IFile file);
42
	public boolean isText(IFile file);
42
	public boolean isText(IRemoteFile remoteFile);
43
	public boolean isText(IRemoteFile remoteFile);
44
	
45
	// Query whether a file should be treated as xml
46
	/**
47
	 * @since 4.0
48
	 */
49
	public boolean isXML(IFile file);
50
	/**
51
	 * @since 4.0
52
	 */
53
	public boolean isXML(IRemoteFile remoteFile);
43
}
54
}
(-)schema/remoteFileTypes.exsd (-35 / +36 lines)
Lines 1-18 Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.rse.subsystems.files.core">
3
<schema targetNamespace="org.eclipse.rse.subsystems.files.core" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
4
<annotation>
5
      <appInfo>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.rse.subsystems.files.core" id="remoteFileTypes" name="Remote File Types"/>
6
         <meta.schema plugin="org.eclipse.rse.subsystems.files.core" id="remoteFileTypes" name="Remote File Types"/>
7
      </appInfo>
7
      </appinfo>
8
      <documentation>
8
      <documentation>
9
         This extension point is used to register information about whether particular file types should be considered to contain text or binary data.
9
         This extension point is used to register information about whether particular file types should be considered to contain text, binary or xml data.
10
This information is important as it will determine how files will be transferred. The exact meaning of how the transfer of text files differs from binary
10
This information is important as it will determine how files will be transferred. The exact meaning of how the transfer of text files differs from binary and xml
11
files depends on the actual file service implementation. In general, though, services will strive to change the encoding of remote text files during transfer
11
files depends on the actual file service implementation. In general, though, services will strive to change the encoding of remote text files during transfer
12
such that it matches the local platform default encoding.
12
such that it matches the local platform default encoding.  File types that are specified as xml will normally transfer as binary but will have it&apos;s encoding determined via inspection of the text.
13
&lt;p&gt;
13
&lt;p&gt;
14
Specific encoding conversions also depend on provided extensions to the
14
Specific encoding conversions also depend on provided extensions to the
15
&lt;a href="org_eclipse_rse_services_codePageConverters.html"&gt;org.eclipse.rse.services.codePageConverters&lt;/a&gt;
15
&lt;a href=&quot;org_eclipse_rse_services_codePageConverters.html&quot;&gt;org.eclipse.rse.services.codePageConverters&lt;/a&gt;
16
extension point.
16
extension point.
17
For example, transferring files from a remote dstore Linux host to a local Windows client, the file service may convert text files from
17
For example, transferring files from a remote dstore Linux host to a local Windows client, the file service may convert text files from
18
UTF-8 encoding to Windows cp1252 encoding, and convert remote LF only line endings to local CRLF line endings.
18
UTF-8 encoding to Windows cp1252 encoding, and convert remote LF only line endings to local CRLF line endings.
Lines 27-32 Link Here
27
   </annotation>
27
   </annotation>
28
28
29
   <element name="extension">
29
   <element name="extension">
30
      <annotation>
31
         <appinfo>
32
            <meta.element />
33
         </appinfo>
34
      </annotation>
30
      <complexType>
35
      <complexType>
31
         <sequence>
36
         <sequence>
32
            <element ref="remoteFileTypes" minOccurs="0" maxOccurs="unbounded"/>
37
            <element ref="remoteFileTypes" minOccurs="0" maxOccurs="unbounded"/>
Lines 50-71 Link Here
50
55
51
   <element name="remoteFileTypes">
56
   <element name="remoteFileTypes">
52
      <annotation>
57
      <annotation>
53
         <appInfo>
58
         <appinfo>
54
            <meta.element labelAttribute="extension"/>
59
            <meta.element labelAttribute="extension"/>
55
         </appInfo>
60
         </appinfo>
56
      </annotation>
61
      </annotation>
57
      <complexType>
62
      <complexType>
58
         <attribute name="extension" type="string" use="required">
63
         <attribute name="extension" type="string" use="required">
59
            <annotation>
64
            <annotation>
60
               <documentation>
65
               <documentation>
61
                  the file extension being identified by this contribution.                 
66
                  the file extension being identified by this contribution.
62
               </documentation>
67
               </documentation>
63
            </annotation>
68
            </annotation>
64
         </attribute>
69
         </attribute>
65
         <attribute name="type" use="required">
70
         <attribute name="type" use="required">
66
            <annotation>
71
            <annotation>
67
               <documentation>
72
               <documentation>
68
                  one of either &quot;text&quot; or &quot;binary&quot;, identifying the contents of files matching the value of extension.                  
73
                  one of either &quot;text&quot; or &quot;binary&quot;, identifying the contents of files matching the value of extension.
69
               </documentation>
74
               </documentation>
70
            </annotation>
75
            </annotation>
71
            <simpleType>
76
            <simpleType>
Lines 74-79 Link Here
74
                  </enumeration>
79
                  </enumeration>
75
                  <enumeration value="binary">
80
                  <enumeration value="binary">
76
                  </enumeration>
81
                  </enumeration>
82
                  <enumeration value="xml">
83
                  </enumeration>
77
               </restriction>
84
               </restriction>
78
            </simpleType>
85
            </simpleType>
79
         </attribute>
86
         </attribute>
Lines 90-138 Link Here
90
   </element>
97
   </element>
91
98
92
   <annotation>
99
   <annotation>
93
      <appInfo>
100
      <appinfo>
94
         <meta.section type="examples"/>
101
         <meta.section type="since"/>
95
      </appInfo>
102
      </appinfo>
96
      <documentation>
103
      <documentation>
97
         &lt;extension point=&quot;org.eclipse.rse.subsystems.files.core.remoteFileTypes&quot;&gt;
104
         3.0
98
 &lt;remoteFileTypes extension=&quot;txt&quot; type=&quot;text&quot;/&gt;
99
 &lt;remoteFileTypes extension=&quot;gif&quot; type=&quot;binary&quot;/&gt;
100
 &lt;remoteFileTypes extension=&quot;exe&quot; type=&quot;binary&quot; priority=&quot;100&quot;/&gt;
101
&lt;/extension&gt;
102
      </documentation>
105
      </documentation>
103
   </annotation>
106
   </annotation>
104
107
105
   <annotation>
108
   <annotation>
106
      <appInfo>
109
      <appinfo>
107
         <meta.section type="apiInfo"/>
110
         <meta.section type="apiInfo"/>
108
      </appInfo>
111
      </appinfo>
109
      <documentation>
112
      <documentation>
110
         There is no code to implement for this extension point.
113
         There is no code to implement for this extension point.
111
      </documentation>
114
      </documentation>
112
   </annotation>
115
   </annotation>
113
116
114
   <annotation>
117
   <annotation>
115
      <appInfo>
118
      <appinfo>
116
         <meta.section type="since"/>
119
         <meta.section type="examples"/>
117
      </appInfo>
120
      </appinfo>
118
      <documentation>
121
      <documentation>
119
         3.0
122
         &lt;extension point=&quot;org.eclipse.rse.subsystems.files.core.remoteFileTypes&quot;&gt;
123
 &lt;remoteFileTypes extension=&quot;txt&quot; type=&quot;text&quot;/&gt;
124
 &lt;remoteFileTypes extension=&quot;gif&quot; type=&quot;binary&quot;/&gt;
125
  &lt;remoteFileTypes extension=&quot;xmi&quot; type=&quot;xml&quot;/&gt;
126
 &lt;remoteFileTypes extension=&quot;exe&quot; type=&quot;binary&quot; priority=&quot;100&quot;/&gt;
127
&lt;/extension&gt;
120
      </documentation>
128
      </documentation>
121
   </annotation>
129
   </annotation>
122
130
123
   <annotation>
124
      <appInfo>
125
         <meta.section type="implementation"/>
126
      </appInfo>
127
      <documentation>
128
         
129
      </documentation>
130
   </annotation>
131
131
132
   <annotation>
132
   <annotation>
133
      <appInfo>
133
      <appinfo>
134
         <meta.section type="copyright"/>
134
         <meta.section type="copyright"/>
135
      </appInfo>
135
      </appinfo>
136
      <documentation>
136
      <documentation>
137
         Copyright (c) 2006, 2007 IBM Corporation. All Rights Reserved.
137
         Copyright (c) 2006, 2007 IBM Corporation. All Rights Reserved.
138
This program and the accompanying materials are made available under the terms
138
This program and the accompanying materials are made available under the terms
Lines 141-146 Link Here
141
141
142
Contributors:
142
Contributors:
143
IBM Corporation - initial API and implementation
143
IBM Corporation - initial API and implementation
144
David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
144
      </documentation>
145
      </documentation>
145
   </annotation>
146
   </annotation>
146
147
(-)src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeMapping.java (-6 / +26 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2008 IBM Corporation and others.
2
 * Copyright (c) 2002, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 15-20 Link Here
15
 * David McKnight   (IBM)        - [208951] new priority field
15
 * David McKnight   (IBM)        - [208951] new priority field
16
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
16
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
17
 * Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
17
 * Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
18
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
18
 *******************************************************************************/
19
 *******************************************************************************/
19
20
20
package org.eclipse.rse.internal.subsystems.files.core.model;
21
package org.eclipse.rse.internal.subsystems.files.core.model;
Lines 33-39 Link Here
33
	public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
34
	public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
34
	private String name;
35
	private String name;
35
	private String extension;
36
	private String extension;
36
	private boolean isBinary = true;
37
	private int fileType = ISystemFileTransferModeMapping.FILE_TYPE_BINARY;
38
	
39
	
37
	private int priority = DEFAULT_PRIORITY;
40
	private int priority = DEFAULT_PRIORITY;
38
41
39
	/**
42
	/**
Lines 96-102 Link Here
96
	 * @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#isBinary()
99
	 * @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#isBinary()
97
	 */
100
	 */
98
	public boolean isBinary() {
101
	public boolean isBinary() {
99
		return isBinary;
102
		return fileType == ISystemFileTransferModeMapping.FILE_TYPE_BINARY;
103
	}
104
	
105
	/*
106
	 * (non-Javadoc)
107
	 * @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#isXML()
108
	 */
109
	public boolean isXML(){
110
		return fileType == ISystemFileTransferModeMapping.FILE_TYPE_XML;
100
	}
111
	}
101
112
102
	/*
113
	/*
Lines 104-126 Link Here
104
	 * @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#isText()
115
	 * @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#isText()
105
	 */
116
	 */
106
	public boolean isText() {
117
	public boolean isText() {
107
		return !isBinary();
118
		return fileType == ISystemFileTransferModeMapping.FILE_TYPE_TEXT;
108
	}
119
	}
109
120
110
	/**
121
	/**
111
	 * Set whether transfer mode is binary
122
	 * Set whether transfer mode is binary
112
	 */
123
	 */
113
	public void setAsBinary() {
124
	public void setAsBinary() {
114
		isBinary = true;
125
		fileType = ISystemFileTransferModeMapping.FILE_TYPE_BINARY;
126
	}
127
	
128
	/**
129
	 * Set whether transfer mode is XML
130
	 */
131
	public void setAsXML() {
132
		fileType = ISystemFileTransferModeMapping.FILE_TYPE_XML;
115
	}
133
	}
116
134
117
	/**
135
	/**
118
	 * Set whether transfer mode is text
136
	 * Set whether transfer mode is text
119
	 */
137
	 */
120
	public void setAsText() {
138
	public void setAsText() {
121
		isBinary = false;
139
		fileType = ISystemFileTransferModeMapping.FILE_TYPE_TEXT;
122
	}
140
	}
123
141
142
	
143
	
124
	/**
144
	/**
125
	 * Set the name
145
	 * Set the name
126
	 */
146
	 */
(-)src/org/eclipse/rse/internal/subsystems/files/core/model/SystemFileTransferModeRegistry.java (-3 / +58 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2008 IBM Corporation and others.
2
 * Copyright (c) 2002, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 15-20 Link Here
15
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
15
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
16
 * David McKnight   (IBM)        - [208951] Use remoteFileTypes extension point to determine file types
16
 * David McKnight   (IBM)        - [208951] Use remoteFileTypes extension point to determine file types
17
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
17
 * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
18
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
18
 *******************************************************************************/
19
 *******************************************************************************/
19
package org.eclipse.rse.internal.subsystems.files.core.model;
20
package org.eclipse.rse.internal.subsystems.files.core.model;
20
21
Lines 73-78 Link Here
73
	private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$
74
	private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$
74
	private static final String BINARY_VALUE = "binary";  //$NON-NLS-1$
75
	private static final String BINARY_VALUE = "binary";  //$NON-NLS-1$
75
	private static final String TEXT_VALUE = "text"; //$NON-NLS-1$
76
	private static final String TEXT_VALUE = "text"; //$NON-NLS-1$
77
	private static final String XML_VALUE = "xml"; //$NON-NLS-1$s
76
	private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
78
	private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
77
79
78
	/**
80
	/**
Lines 145-150 Link Here
145
					if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
147
					if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
146
						mapping.setAsBinary();
148
						mapping.setAsBinary();
147
					}
149
					}
150
					
151
					// add extension to list of xml types
152
					if (type.equalsIgnoreCase("xml")) { //$NON-NLS-1$
153
						mapping.setAsXML();
154
					}
148
155
149
					int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
156
					int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
150
					String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
157
					String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
Lines 302-309 Link Here
302
		return isText(remoteFile.getName());
309
		return isText(remoteFile.getName());
303
	}
310
	}
304
311
312
	/**
313
	 * @see ISystemFileTransferModeRegistry#isText(String)
314
	 */
315
	public boolean isXML(String fileName) {
316
		return getMapping(fileName).isXML();
317
	}
318
319
320
	/**
321
	 * @see ISystemFileTransferModeRegistry#isText(File)
322
	 */
323
	public boolean isXML(File file) {
324
		return isXML(file.getName());
325
	}
326
327
328
	/**
329
	 * @see ISystemFileTransferModeRegistry#isText(IFile)
330
	 */
331
	public boolean isXML(IFile file) {
332
		return isXML(file.getName());
333
	}
334
305
335
306
	/**
336
	/**
337
	 * @see ISystemFileTransferModeRegistry#isText(IRemoteFile)
338
	 */
339
	public boolean isXML(IRemoteFile remoteFile) {
340
		return isXML(remoteFile.getName());
341
	}
342
	
343
	/**
307
	 * Get the mode mapping given a file name
344
	 * Get the mode mapping given a file name
308
	 */
345
	 */
309
	private SystemFileTransferModeMapping getMapping(String fileName) {
346
	private SystemFileTransferModeMapping getMapping(String fileName) {
Lines 357-367 Link Here
357
		{
394
		{
358
			fileMapping.setAsText();
395
			fileMapping.setAsText();
359
		}
396
		}
360
		else
397
		else if (mapping.isXML())
398
		{
399
			fileMapping.setAsXML();
400
		}
401
		else 
361
		{
402
		{
362
			fileMapping.setAsBinary();
403
			fileMapping.setAsBinary();
363
		}
404
		}
364
405
406
365
		return fileMapping;
407
		return fileMapping;
366
	}
408
	}
367
409
Lines 458-463 Link Here
458
				if (mode.equals(TEXT_VALUE)) {
500
				if (mode.equals(TEXT_VALUE)) {
459
					mapping.setAsText();
501
					mapping.setAsText();
460
				}
502
				}
503
				else if (mode.equals(XML_VALUE)){
504
					mapping.setAsXML();
505
				}
461
				else {
506
				else {
462
					mapping.setAsBinary();
507
					mapping.setAsBinary();
463
				}
508
				}
Lines 523-529 Link Here
523
			IMemento infoMemento = memento.createChild(INFO_NODE);
568
			IMemento infoMemento = memento.createChild(INFO_NODE);
524
			infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
569
			infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
525
			infoMemento.putString(EXTENSION_ATTRIBUTE, mapping.getExtension());
570
			infoMemento.putString(EXTENSION_ATTRIBUTE, mapping.getExtension());
526
			infoMemento.putString(MODE_ATTRIBUTE, mapping.isBinary() ? BINARY_VALUE : TEXT_VALUE);
571
			
572
			if (mapping.isText()){
573
				infoMemento.putString(MODE_ATTRIBUTE, TEXT_VALUE);
574
			}
575
			else if (mapping.isXML()){
576
				infoMemento.putString(MODE_ATTRIBUTE, XML_VALUE);
577
			}
578
			else {
579
				infoMemento.putString(MODE_ATTRIBUTE, BINARY_VALUE);
580
			}
581
527
			infoMemento.putInteger(PRIORITY_ATTRIBUTE, mapping.getPriority());
582
			infoMemento.putInteger(PRIORITY_ATTRIBUTE, mapping.getPriority());
528
		}
583
		}
529
584
(-)src/org/eclipse/rse/internal/subsystems/files/core/Activator.java (+36 lines)
Lines 16-26 Link Here
16
 * Martin Oberhuber (wind River) - [203105] Decouple recursive plugin activation of UI adapters
16
 * Martin Oberhuber (wind River) - [203105] Decouple recursive plugin activation of UI adapters
17
 * David McKnight   (IBM)        - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
17
 * David McKnight   (IBM)        - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
18
 * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading
18
 * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading
19
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
19
 *******************************************************************************/
20
 *******************************************************************************/
20
21
21
package org.eclipse.rse.internal.subsystems.files.core;
22
package org.eclipse.rse.internal.subsystems.files.core;
22
23
24
import org.eclipse.core.resources.ResourcesPlugin;
25
import org.eclipse.core.runtime.IProgressMonitor;
26
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Plugin;
27
import org.eclipse.core.runtime.Plugin;
28
import org.eclipse.core.runtime.Status;
29
import org.eclipse.core.runtime.jobs.Job;
30
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
31
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
24
import org.osgi.framework.BundleContext;
32
import org.osgi.framework.BundleContext;
25
33
26
/**
34
/**
Lines 40-50 Link Here
40
		plugin = this;
48
		plugin = this;
41
	}
49
	}
42
50
51
	class RSEDefaultEncodingProvider extends SystemEncodingUtil.DefaultEncodingProvider{
52
		public String getLocalDefaultEncoding() {
53
			return ResourcesPlugin.getEncoding();
54
		}
55
		
56
		public boolean isXML(String path){
57
			boolean result = super.isXML(path);
58
			if (!result){
59
				// now check the extension point mappings
60
				RemoteFileUtility.getSystemFileTransferModeRegistry().isXML(path);
61
			}
62
						
63
			return result;
64
		}
65
	}
66
	
43
	/**
67
	/**
44
	 * This method is called upon plug-in activation
68
	 * This method is called upon plug-in activation
45
	 */
69
	 */
46
	public void start(BundleContext context) throws Exception {
70
	public void start(BundleContext context) throws Exception {
47
		super.start(context);
71
		super.start(context);
72
		
73
		Job setupEncodingProvider = new Job("setup encoding provider"){ //$NON-NLS-1$
74
			
75
			public IStatus run(IProgressMonitor monitor){
76
				// set the default encoding provider
77
				SystemEncodingUtil encodingUtil = SystemEncodingUtil.getInstance();
78
				encodingUtil.setDefaultEncodingProvider(new RSEDefaultEncodingProvider());								
79
				return Status.OK_STATUS;
80
			}
81
		};
82
		setupEncodingProvider.setSystem(true);
83
		setupEncodingProvider.schedule();
48
	}
84
	}
49
85
50
	/**
86
	/**
(-)src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java (-2 / +6 lines)
Lines 21-26 Link Here
21
 * Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
21
 * Martin Oberhuber (Wind River) - [219975] Fix implementations of clone()
22
 * David McKnight   (IBM)        - [231209] [api][breaking] IRemoteFile.getSystemConnection() should be changed to IRemoteFile.getHost()
22
 * David McKnight   (IBM)        - [231209] [api][breaking] IRemoteFile.getSystemConnection() should be changed to IRemoteFile.getHost()
23
 * David McKnight   (IBM)        - [277911] cached results of remote file query need to be sorted
23
 * David McKnight   (IBM)        - [277911] cached results of remote file query need to be sorted
24
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
24
 *******************************************************************************/
25
 *******************************************************************************/
25
26
26
package org.eclipse.rse.subsystems.files.core.subsystems;
27
package org.eclipse.rse.subsystems.files.core.subsystems;
Lines 52-57 Link Here
52
import org.eclipse.rse.services.files.IHostFile;
53
import org.eclipse.rse.services.files.IHostFile;
53
import org.eclipse.rse.services.files.IHostFilePermissions;
54
import org.eclipse.rse.services.files.IHostFilePermissions;
54
import org.eclipse.rse.services.files.IHostFilePermissionsContainer;
55
import org.eclipse.rse.services.files.IHostFilePermissionsContainer;
56
import org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeRegistry;
55
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
57
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
56
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
58
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
57
import org.eclipse.rse.ui.SystemBasePlugin;
59
import org.eclipse.rse.ui.SystemBasePlugin;
Lines 383-390 Link Here
383
	{
385
	{
384
		if (isDirectory())
386
		if (isDirectory())
385
		  return false;
387
		  return false;
386
		else
388
		else {
387
		  return RemoteFileUtility.getSystemFileTransferModeRegistry().isBinary(this);
389
			ISystemFileTransferModeRegistry reg = RemoteFileUtility.getSystemFileTransferModeRegistry();
390
			return reg.isBinary(this) || reg.isXML(this); // xml files also transfer as binary
391
		}
388
	}
392
	}
389
393
390
	/**
394
	/**
(-)clientserver/org/eclipse/rse/services/clientserver/ISystemFileTypes.java (-6 / +8 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2006 IBM Corporation. All rights reserved.
2
 * Copyright (c) 2009 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 11-17 Link Here
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
12
 * 
13
 * Contributors:
13
 * Contributors:
14
 * {Name} (company) - description of contribution.
14
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
15
 ********************************************************************************/
15
 ********************************************************************************/
16
16
17
17
Lines 19-31 Link Here
19
19
20
import java.io.File;
20
import java.io.File;
21
21
22
/**
22
23
 * @author dmcknigh
24
 */
25
public interface ISystemFileTypes  
23
public interface ISystemFileTypes  
26
{
24
{
27
    public boolean isBinary(File file);
25
    public boolean isBinary(File file);
28
    public boolean isText(File file);
26
    public boolean isText(File file);
27
28
    public boolean isXML(File file);
29
    public boolean isBinary(String file);
29
    public boolean isBinary(String file);
30
    public boolean isText(String file);
30
    public boolean isText(String file);
31
}
31
32
    public boolean isXML(String file);
33
} 
(-)clientserver/org/eclipse/rse/services/clientserver/SystemEncodingUtil.java (-25 / +30 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
2
 * Copyright (c) 2006, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 14-19 Link Here
14
 * Contributors:
14
 * Contributors:
15
 * David McKnight   (IBM) [215847]SystemEncodingUtil needs to convert to unsigned when checking xml file
15
 * David McKnight   (IBM) [215847]SystemEncodingUtil needs to convert to unsigned when checking xml file
16
 * David McKnight     (IBM)      - [229610] [api] File transfers should use workspace text file encoding
16
 * David McKnight     (IBM)      - [229610] [api] File transfers should use workspace text file encoding
17
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
17
 *******************************************************************************/
18
 *******************************************************************************/
18
19
19
package org.eclipse.rse.services.clientserver;
20
package org.eclipse.rse.services.clientserver;
Lines 71-76 Link Here
71
	      public String getLocalDefaultEncoding() {
72
	      public String getLocalDefaultEncoding() {
72
	          return System.getProperty("file.encoding"); //$NON-NLS-1$
73
	          return System.getProperty("file.encoding"); //$NON-NLS-1$
73
	      }
74
	      }
75
	      
76
77
	    public boolean isXML(String filePath) {
78
			int index = filePath.lastIndexOf("."); //$NON-NLS-1$
79
80
			// check if there is a "."
81
			if (index == -1) {
82
				return false;
83
			}
84
			else {
85
86
				// check if the name ends with "."
87
				if (index == filePath.length() - 1) {
88
					return false;
89
				}
90
				else {
91
					String extension = filePath.substring(index+1);
92
93
					if (extension.equalsIgnoreCase("xml") || extension.equalsIgnoreCase("xmi")) { //$NON-NLS-1$ //$NON-NLS-2$
94
						return true;
95
					}
96
					else {
97
						return false;
98
					}
99
				}
100
			}
101
	      }
74
	   }
102
	   }
75
103
76
   	/**
104
   	/**
Lines 115-144 Link Here
115
	 * @return <code>true</code> if the file is an XML file, <code>false</code> otherwise.
143
	 * @return <code>true</code> if the file is an XML file, <code>false</code> otherwise.
116
	 */
144
	 */
117
	public boolean isXML(String filePath) {
145
	public boolean isXML(String filePath) {
118
146
		return _defaultEncodingProvider.isXML(filePath);
119
		int index = filePath.lastIndexOf("."); //$NON-NLS-1$
120
121
		// check if there is a "."
122
		if (index == -1) {
123
			return false;
124
		}
125
		else {
126
127
			// check if the name ends with "."
128
			if (index == filePath.length() - 1) {
129
				return false;
130
			}
131
			else {
132
				String extension = filePath.substring(index+1);
133
134
				if (extension.equalsIgnoreCase("xml") || extension.equalsIgnoreCase("xmi")) { //$NON-NLS-1$ //$NON-NLS-2$
135
					return true;
136
				}
137
				else {
138
					return false;
139
				}
140
			}
141
		}
142
	}
147
	}
143
148
144
	/**
149
	/**
(-)src/org/eclipse/rse/internal/core/RSEInitJob.java (-5 / +7 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2009 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 10-15 Link Here
10
 * David McKnight     (IBM)      - [229610] [api] File transfers should use workspace text file encoding
10
 * David McKnight     (IBM)      - [229610] [api] File transfers should use workspace text file encoding
11
 * David Dykstal (IBM) = [226958] add status values to waitForInitCompletion(phase)
11
 * David Dykstal (IBM) = [226958] add status values to waitForInitCompletion(phase)
12
 * David Dykstal (IBM) - [235581] Initialize RSE should be a daemon job
12
 * David Dykstal (IBM) - [235581] Initialize RSE should be a daemon job
13
 * David McKnight (IBM)  - [283033] remoteFileTypes extension point should include "xml" type
13
 ********************************************************************************/
14
 ********************************************************************************/
14
package org.eclipse.rse.internal.core;
15
package org.eclipse.rse.internal.core;
15
16
Lines 18-24 Link Here
18
import java.util.ArrayList;
19
import java.util.ArrayList;
19
import java.util.List;
20
import java.util.List;
20
21
21
import org.eclipse.core.resources.ResourcesPlugin;
22
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.IConfigurationElement;
23
import org.eclipse.core.runtime.IConfigurationElement;
24
import org.eclipse.core.runtime.IPath;
24
import org.eclipse.core.runtime.IPath;
Lines 40-46 Link Here
40
import org.eclipse.rse.internal.core.model.SystemModelChangeEvent;
40
import org.eclipse.rse.internal.core.model.SystemModelChangeEvent;
41
import org.eclipse.rse.internal.core.model.SystemProfileManager;
41
import org.eclipse.rse.internal.core.model.SystemProfileManager;
42
import org.eclipse.rse.logging.Logger;
42
import org.eclipse.rse.logging.Logger;
43
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
44
43
45
/**
44
/**
46
 * This is a job named "Initialize RSE". It is instantiated and run during
45
 * This is a job named "Initialize RSE". It is instantiated and run during
Lines 187-193 Link Here
187
			}
186
			}
188
		}
187
		}
189
	}
188
	}
190
189
	
191
	/* (non-Javadoc)
190
	/* (non-Javadoc)
192
	 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
191
	 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
193
	 */
192
	 */
Lines 221-226 Link Here
221
			submonitor.done();
220
			submonitor.done();
222
		}
221
		}
223
222
223
		/*
224
		 * default encoding provider moved to startup of files.core
224
		// set the default encoding provider
225
		// set the default encoding provider
225
		SystemEncodingUtil encodingUtil = SystemEncodingUtil.getInstance();
226
		SystemEncodingUtil encodingUtil = SystemEncodingUtil.getInstance();
226
		encodingUtil.setDefaultEncodingProvider(
227
		encodingUtil.setDefaultEncodingProvider(
Lines 229-235 Link Here
229
						   return ResourcesPlugin.getEncoding();
230
						   return ResourcesPlugin.getEncoding();
230
					   }
231
					   }
231
				});
232
				});
232
233
*/
234
		
233
		initializerPhase.done(result);
235
		initializerPhase.done(result);
234
		// finish up - propogate cancel if necessary
236
		// finish up - propogate cancel if necessary
235
		if (monitor.isCanceled()) {
237
		if (monitor.isCanceled()) {

Return to bug 283033