Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 70049 Details for
Bug 189352
[dstore] Copy & Paste transfers binary although text mode specified
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Check for Linux/Unix system type and replace line end character
Upload_Binary_Text.txt (text/plain), 5.09 KB, created by
Kushal Munir
on 2007-06-04 18:37:58 EDT
(
hide
)
Description:
Check for Linux/Unix system type and replace line end character
Filename:
MIME Type:
Creator:
Kushal Munir
Created:
2007-06-04 18:37:58 EDT
Size:
5.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services.dstore >Index: src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java,v >retrieving revision 1.10 >diff -u -r1.10 DStoreFileService.java >--- src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 4 Jun 2007 20:37:49 -0000 1.10 >+++ src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 4 Jun 2007 22:35:32 -0000 >@@ -14,6 +14,7 @@ > * Kevin Doyle (IBM) - Fix 183870 - Display File Exists Error > * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API > * Xuan Chen (IBM) - [189681] [dstore][linux] Refresh Folder in My Home messes up Refresh in Root >+ * Kushal Munir (IBM) - [189352] Replace with appropriate line end character on upload > ********************************************************************************/ > > package org.eclipse.rse.internal.services.dstore.files; >@@ -71,6 +72,8 @@ > protected ISystemFileTypes _fileTypeRegistry; > private String remoteEncoding; > >+ protected boolean unixStyle = false; >+ > private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ > > private static String[] _filterAttributes = { >@@ -411,12 +414,33 @@ > if (!isBinary && srcEncoding != null && hostEncoding != null) > { > String tempStr = new String(buffer, 0, bytesRead, srcEncoding); >- >- // hack for zOS - \r causes problems for compilers >-// if (osName != null && (osName.startsWith("z") || osName.equalsIgnoreCase("aix"))) >-// { >-// tempStr = tempStr.replace('\r', ' '); >-// } >+ >+ if (unixStyle) { >+ int index = tempStr.indexOf("\r\n"); //$NON-NLS-1$ >+ >+ StringBuffer buf = new StringBuffer(); >+ >+ boolean lineEndFound = false; >+ int lastIndex = 0; >+ >+ while (index != -1) { >+ buf = buf.append(tempStr.substring(lastIndex, index)); >+ buf = buf.append('\n'); >+ >+ if (!lineEndFound) { >+ lineEndFound = true; >+ } >+ >+ lastIndex = index+2; >+ >+ index = tempStr.indexOf("\r\n", lastIndex); //$NON-NLS-1$ >+ } >+ >+ if (lineEndFound) { >+ buf = buf.append(tempStr.substring(lastIndex)); >+ tempStr = buf.toString(); >+ } >+ } > > convBytes = tempStr.getBytes(hostEncoding); > >@@ -465,9 +489,6 @@ > > String str = MessageFormat.format(_percentMsg, new Object[] {totalSentBuf, totalBuf, percentBuf}); > monitor.subTask(str); >- >- >- > > isCancelled = monitor.isCanceled(); > } >@@ -1347,4 +1368,13 @@ > DStoreOutputStream outputStream = new DStoreOutputStream(getDataStore(), remotePath, getEncoding(monitor), mode); > return outputStream; > } >+ >+ /** >+ * Sets whether this is a Unix-style file system or a Windows-style file system. The >+ * default is Windows if this is not called. The creator of this class should call this to set the type of the file system. >+ * @param isUnixStyle <code>true<code> if this is a Unix-style file system, <code>false</code> otherwise. >+ */ >+ public void setIsUnixStyle(boolean isUnixStyle) { >+ this.unixStyle = isUnixStyle; >+ } > } >\ No newline at end of file >#P org.eclipse.rse.subsystems.files.dstore >Index: src/org/eclipse/rse/subsystems/files/dstore/DStoreFileSubSystemConfiguration.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/DStoreFileSubSystemConfiguration.java,v >retrieving revision 1.4 >diff -u -r1.4 DStoreFileSubSystemConfiguration.java >--- src/org/eclipse/rse/subsystems/files/dstore/DStoreFileSubSystemConfiguration.java 15 May 2007 16:52:40 -0000 1.4 >+++ src/org/eclipse/rse/subsystems/files/dstore/DStoreFileSubSystemConfiguration.java 4 Jun 2007 22:35:32 -0000 >@@ -13,6 +13,7 @@ > * > * Contributors: > * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods >+ * Kushal Munir (IBM) - [189352] Set whether file service is Unix-style system or not > *******************************************************************************/ > > package org.eclipse.rse.subsystems.files.dstore; >@@ -134,6 +135,7 @@ > { > DStoreConnectorService connectorService = (DStoreConnectorService)getConnectorService(host); > DStoreFileService service = new DStoreFileService(connectorService, SystemFileTransferModeRegistry.getInstance(), RSEUIPlugin.getDefault()); >+ service.setIsUnixStyle(isUnixStyle()); > > IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore(); > int downloadBufferSize = store.getInt(ISystemFilePreferencesConstants.DOWNLOAD_BUFFER_SIZE);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189352
:
70046
|
70049
|
70071