本文整理汇总了Java中de.schlichtherle.truezip.file.TFileInputStream类的典型用法代码示例。如果您正苦于以下问题:Java TFileInputStream类的具体用法?Java TFileInputStream怎么用?Java TFileInputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TFileInputStream类属于de.schlichtherle.truezip.file包,在下文中一共展示了TFileInputStream类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkContentsOfFile
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
private void checkContentsOfFile(String location, String expectedContents)
throws IOException
{
File file = new TFile(location);
assertTrue(file.exists());
BufferedReader reader = null;
try
{
reader = new BufferedReader(new InputStreamReader(new TFileInputStream(file)));
String line = reader.readLine();
assertNotNull(line);
assertEquals(expectedContents, line.trim());
}
finally
{
if (reader != null)
{
try { reader.close(); } catch (Throwable e ) {}
}
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ModuleManagementToolTest.java
示例2: scan
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
@Override
public void scan(File file, String filename, ICsvImportFileVisitor<CsvTable, CsvRow, CsvCell, CsvCellReference> visitor) throws TableImportException {
Validate.notNull(file, "file must not be null");
Validate.notNull(visitor, "visitor must not be null");
OpenCsvImportNavigator navigator = new OpenCsvImportNavigator(filename);
try (
InputStream stream = new TFileInputStream(file);
Reader reader = createReader(stream, filename);
CSVReader csvReader = createCsvReader(reader, filename)
) {
CsvTable sheet = new CsvTable(csvReader.readAll());
visitor.visitTable(navigator, sheet);
} catch (IOException e) {
throw new TableImportFileException(e, navigator.getLocation(null, null, null));
}
}
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:19,代码来源:OpenCsvImportFileScanner.java
示例3: scan
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
@Override
public void scan(File file, String filename, SheetSelection selection, IExcelImportFileVisitor<Workbook, Sheet, Row, Cell, CellReference> visitor) throws TableImportException {
Validate.notNull(file, "file must not be null");
Validate.notNull(visitor, "visitor must not be null");
ApachePoiImportNavigator navigator = new ApachePoiImportNavigator(filename);
try (InputStream stream = new TFileInputStream(file)) {
Workbook workbook = WorkbookFactory.create(stream);
for (int index = 0 ; index < workbook.getNumberOfSheets() ; ++index) {
Sheet sheet = workbook.getSheetAt(index);
if (navigator.tableHasContent(sheet) && SELECTIONS_PREDICATES.get(selection).apply(sheet)) {
visitor.visitSheet(navigator, workbook, sheet);
}
}
} catch (InvalidFormatException | IOException | IllegalArgumentException e) {
throw new TableImportFileException(e, navigator.getLocation(null, null, null));
}
}
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:21,代码来源:ApachePoiImportFileScanner.java
示例4: importProjects
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
@Override
public void importProjects(File file) throws FileNotFoundException, IOException {
Map<String, Map<String, GenericEntity<Long, ?>>> idsMapping = new HashMap<String, Map<String, GenericEntity<Long, ?>>>();
Workbook workbook = new HSSFWorkbook(new TFileInputStream(file));
doImportItem(idsMapping, workbook, Project.class);
doImportItem(idsMapping, workbook, ProjectVersion.class);
}
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:9,代码来源:ProjectImportDataServiceImpl.java
示例5: internalEqualsOrSameContent
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
@SuppressWarnings("OverlyComplexMethod")
private static boolean internalEqualsOrSameContent(@Nonnull File fileA, @Nonnull File fileB) throws IOException {
if (fileA.equals(fileB)) {
return true;
}
if (fileA.isFile()) {
if (fileB.isFile()) {
InputStream inputStreamA = null;
InputStream inputStreamB = null;
try {
return fileA.length() == fileB.length() && IoUtil.contentEquals(
inputStreamA = fileA instanceof TFile
? new TFileInputStream(fileA)
: new FileInputStream(fileA),
inputStreamB = fileB instanceof TFile
? new TFileInputStream(fileB)
: new FileInputStream(fileB)
);
} finally {
IoUtil.closeQuietly(inputStreamA, inputStreamB);
}
} else {
return false;
}
}
if (fileA.isDirectory()) {
if (fileB.isDirectory()) {
File[] childrenA = fileA.listFiles();
int childACount = childrenA == null ? 0 : childrenA.length;
if (childACount != ArrayUtils.getLength(fileB.listFiles())) {
return false;
}
for (int childIndex = 0; childIndex < childACount; ++childIndex) {
File childA = childrenA[childIndex];
File childB = fileB instanceof TFile
? new TFile(fileB, childA.getName())
: new File(fileB, childA.getName());
if (!internalEqualsOrSameContent(childA, childB)) {
return false;
}
}
return true;
} else {
return false;
}
}
return false;
}
开发者ID:Codeforces,项目名称:codeforces-commons,代码行数:57,代码来源:FileUtil.java
示例6: importDirectory
import de.schlichtherle.truezip.file.TFileInputStream; //导入依赖的package包/类
@Override
public void importDirectory(File directory) throws ServiceException, SecurityServiceException, FileNotFoundException, IOException {
Map<String, Map<String, GenericEntity<Long, ?>>> idsMapping = new HashMap<String, Map<String, GenericEntity<Long, ?>>>();
importBeforeReferenceData(directory, idsMapping);
LOGGER.info("Importing {}", REFERENCE_DATA_FILE);
Workbook genericListItemWorkbook = new HSSFWorkbook(new TFileInputStream(FileUtils.getFile(directory, REFERENCE_DATA_FILE)));
importGenericListItems(idsMapping, genericListItemWorkbook);
LOGGER.info("Import of {} complete", REFERENCE_DATA_FILE);
importAfterReferenceData(directory, idsMapping);
importBeforeBusinessData(directory, idsMapping);
LOGGER.info("Importing {}", BUSINESS_DATA_FILE);
Workbook businessItemWorkbook = new HSSFWorkbook(new TFileInputStream(FileUtils.getFile(directory, BUSINESS_DATA_FILE)));
importMainBusinessItems(idsMapping, businessItemWorkbook);
LOGGER.info("Import of {} complete", BUSINESS_DATA_FILE);
importAfterBusinessData(directory, idsMapping);
importFiles(directory, idsMapping);
propertyService.set(DATABASE_INITIALIZED, true);
LOGGER.info("Import complete");
}
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:29,代码来源:AbstractImportDataServiceImpl.java
注:本文中的de.schlichtherle.truezip.file.TFileInputStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论