ADLSOutputFile.java org::apache::iceberg::azure::adlsv2::ADLSOutputFile org::apache::iceberg::azure::adlsv2 /* *LicensedtotheApacheSoftwareFoundation(ASF)underone *ormorecontributorlicenseagreements.SeetheNOTICEfile *distributedwiththisworkforadditionalinformation *regardingcopyrightownership.TheASFlicensesthisfile *toyouundertheApacheLicense,Version2.0(the *"License");youmaynotusethisfileexceptincompliance *withtheLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting, *softwaredistributedundertheLicenseisdistributedonan *"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANY *KIND,eitherexpressorimplied.SeetheLicenseforthe *specificlanguagegoverningpermissionsandlimitations *undertheLicense. */ packageorg.apache.iceberg.azure.adlsv2; importcom.azure.storage.file.datalake.DataLakeFileClient; importjava.io.IOException; importjava.io.UncheckedIOException; importorg.apache.iceberg.azure.AzureProperties; importorg.apache.iceberg.exceptions.AlreadyExistsException; importorg.apache.iceberg.io.InputFile; importorg.apache.iceberg.io.OutputFile; importorg.apache.iceberg.io.PositionOutputStream; importorg.apache.iceberg.metrics.MetricsContext; classADLSOutputFileextendsBaseADLSFileimplementsOutputFile{ ADLSOutputFile( Stringlocation, DataLakeFileClientfileClient, AzurePropertiesazureProperties, MetricsContextmetrics){ super(location,fileClient,azureProperties,metrics); } @Override publicPositionOutputStreamcreate(){ if(!exists()){ returncreateOrOverwrite(); }else{ thrownewAlreadyExistsException("Locationalreadyexists:%s",location()); } } @Override publicPositionOutputStreamcreateOrOverwrite(){ try{ returnnewADLSOutputStream(fileClient(),azureProperties(),metrics()); }catch(IOExceptione){ thrownewUncheckedIOException( "Failedtocreateoutputstreamforlocation:"+location(),e); } } @Override publicInputFiletoInputFile(){ returnnewADLSInputFile(location(),fileClient(),azureProperties(),metrics()); } }