InvalidHeaderException.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // InvalidHeaderException.cs
  2. //
  3. // Copyright (C) 2001 Mike Krueger
  4. //
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. // Linking this library statically or dynamically with other modules is
  20. // making a combined work based on this library. Thus, the terms and
  21. // conditions of the GNU General Public License cover the whole
  22. // combination.
  23. //
  24. // As a special exception, the copyright holders of this library give you
  25. // permission to link this library with independent modules to produce an
  26. // executable, regardless of the license terms of these independent
  27. // modules, and to copy and distribute the resulting executable under
  28. // terms of your choice, provided that you also meet, for each linked
  29. // independent module, the terms and conditions of the license of that
  30. // module. An independent module is a module which is not derived from
  31. // or based on this library. If you modify this library, you may extend
  32. // this exception to your version of the library, but you are not
  33. // obligated to do so. If you do not wish to do so, delete this
  34. // exception statement from your version.
  35. using System;
  36. #if !NETCF_1_0 && !NETCF_2_0
  37. using System.Runtime.Serialization;
  38. #endif
  39. namespace CommonMPQ.SharpZipLib.Tar {
  40. /// <summary>
  41. /// This exception is used to indicate that there is a problem
  42. /// with a TAR archive header.
  43. /// </summary>
  44. #if !NETCF_1_0 && !NETCF_2_0
  45. [Serializable]
  46. #endif
  47. public class InvalidHeaderException : TarException
  48. {
  49. #if !NETCF_1_0 && !NETCF_2_0
  50. /// <summary>
  51. /// Deserialization constructor
  52. /// </summary>
  53. /// <param name="information"><see cref="SerializationInfo"/> for this constructor</param>
  54. /// <param name="context"><see cref="StreamingContext"/> for this constructor</param>
  55. protected InvalidHeaderException(SerializationInfo information, StreamingContext context)
  56. : base(information, context)
  57. {
  58. }
  59. #endif
  60. /// <summary>
  61. /// Initialise a new instance of the InvalidHeaderException class.
  62. /// </summary>
  63. public InvalidHeaderException()
  64. {
  65. }
  66. /// <summary>
  67. /// Initialises a new instance of the InvalidHeaderException class with a specified message.
  68. /// </summary>
  69. /// <param name="message">Message describing the exception cause.</param>
  70. public InvalidHeaderException(string message)
  71. : base(message)
  72. {
  73. }
  74. /// <summary>
  75. /// Initialise a new instance of InvalidHeaderException
  76. /// </summary>
  77. /// <param name="message">Message describing the problem.</param>
  78. /// <param name="exception">The exception that is the cause of the current exception.</param>
  79. public InvalidHeaderException(string message, Exception exception)
  80. : base(message, exception)
  81. {
  82. }
  83. }
  84. }
  85. /* The original Java file had this header:
  86. ** Authored by Timothy Gerard Endres
  87. ** <mailto:time@gjt.org> <http://www.trustice.com>
  88. **
  89. ** This work has been placed into the public domain.
  90. ** You may use this work in any way and for any purpose you wish.
  91. **
  92. ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
  93. ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
  94. ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
  95. ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
  96. ** REDISTRIBUTION OF THIS SOFTWARE.
  97. **
  98. */