Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

FileHandler.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.stress;
  16. import java.io.File;
  17. import java.io.InputStream;
  18. /**
  19. * Base interface for the various file types that are
  20. * used in the stress testing.
  21. */
  22. public interface FileHandler {
  23. /**
  24. * The FileHandler receives a stream ready for reading the
  25. * file and should handle the content that is provided and
  26. * try to read and interpret the data.
  27. *
  28. * Closing is handled by the framework outside this call.
  29. *
  30. * @param stream
  31. * @throws Exception
  32. */
  33. void handleFile(InputStream stream) throws Exception;
  34. /**
  35. * Ensures that extracting text from the given file
  36. * is returning some text.
  37. */
  38. void handleExtracting(File file) throws Exception;
  39. }