You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

UnicodePathExtraField.java 2.4 kB

11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. package org.apache.tools.zip;
  19. /**
  20. * Info-ZIP Unicode Path Extra Field (0x7075):
  21. *
  22. * <p>Stores the UTF-8 version of the file name field as stored in the
  23. * local header and central directory header.</p>
  24. *
  25. * <p>See <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">PKWARE's
  26. * APPNOTE.TXT, section 4.6.9</a>.</p>
  27. */
  28. public class UnicodePathExtraField extends AbstractUnicodeExtraField {
  29. public static final ZipShort UPATH_ID = new ZipShort(0x7075);
  30. public UnicodePathExtraField() {
  31. }
  32. /**
  33. * Assemble as unicode path extension from the name given as
  34. * text as well as the encoded bytes actually written to the archive.
  35. *
  36. * @param text The file name
  37. * @param bytes the bytes actually written to the archive
  38. * @param off The offset of the encoded filename in <code>bytes</code>.
  39. * @param len The length of the encoded filename or comment in
  40. * <code>bytes</code>.
  41. */
  42. public UnicodePathExtraField(final String text, final byte[] bytes, final int off, final int len) {
  43. super(text, bytes, off, len);
  44. }
  45. /**
  46. * Assemble as unicode path extension from the name given as
  47. * text as well as the encoded bytes actually written to the archive.
  48. *
  49. * @param name The file name
  50. * @param bytes the bytes actually written to the archive
  51. */
  52. public UnicodePathExtraField(final String name, final byte[] bytes) {
  53. super(name, bytes);
  54. }
  55. /** {@inheritDoc} */
  56. public ZipShort getHeaderId() {
  57. return UPATH_ID;
  58. }
  59. }