jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java
changeset 21280 68b145d54e2a
parent 21271 62d0e22ef687
child 23238 57997d148fc0
equal deleted inserted replaced
21279:9ac9af07f1ce 21280:68b145d54e2a
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1738                     // silently drop the URIs that aren't local files.
  1738                     // silently drop the URIs that aren't local files.
  1739                 }
  1739                 }
  1740             }
  1740             }
  1741             theObject = files;
  1741             theObject = files;
  1742 
  1742 
       
  1743         // Target data is a String. Strip terminating NUL bytes. Decode bytes
       
  1744         // into characters. Search-and-replace EOLN.
       
  1745         } else if (String.class.equals(flavor.getRepresentationClass()) &&
       
  1746                    isFlavorCharsetTextType(flavor) && isTextFormat(format)) {
       
  1747 
       
  1748             return translateBytesToString(inputStreamToByteArray(str),
       
  1749                 format, localeTransferable);
       
  1750 
  1743             // Special hack to maintain backwards-compatibility with the brokenness
  1751             // Special hack to maintain backwards-compatibility with the brokenness
  1744             // of StringSelection. Return a StringReader instead of an InputStream.
  1752             // of StringSelection. Return a StringReader instead of an InputStream.
  1745             // Recur to obtain String and encapsulate.
  1753             // Recur to obtain String and encapsulate.
  1746         } else if (DataFlavor.plainTextFlavor.equals(flavor)) {
  1754         } else if (DataFlavor.plainTextFlavor.equals(flavor)) {
  1747             theObject = new StringReader(translateBytesToString(
  1755             theObject = new StringReader(translateBytesToString(