Codota Logo
ValueDataUtil.getFileEncoding
Code IndexAdd Codota to your IDE (free)

How to use
getFileEncoding
method
in
org.pentaho.di.core.row.ValueDataUtil

Best Java code snippets using org.pentaho.di.core.row.ValueDataUtil.getFileEncoding (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

/**
 * Get file encoding.
 *
 * @param metaA
 *          The ValueMetaInterface
 * @param dataA
 *          The value (filename)
 * @return file encoding.
 * @deprecated Use {@link ValueDataUtil#getFileEncoding(ValueMetaInterface, Object, boolean)} instead
 */
@Deprecated
public static String getFileEncoding( ValueMetaInterface metaA, Object dataA ) throws KettleValueException {
 String encoding = null;
 try {
  encoding = getFileEncoding( metaA, dataA, true );
 } catch ( KettleFileNotFoundException e ) {
  throw new KettleValueException();
 }
 return encoding;
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingWithFailIfNoFileTest() throws Exception {
 String path = getClass().getResource( "txt-sample.txt" ).getPath();
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), path, true );
 assertEquals( "US-ASCII", encoding );
}
origin: pentaho/pentaho-kettle

@Test( expected = KettleFileNotFoundException.class )
public void getFileEncodingFailIfNoFileTest() throws KettleFileNotFoundException, KettleValueException {
 String nonExistingPath = "nonExistingPath";
 ValueDataUtil.getFileEncoding( new ValueMetaString(), nonExistingPath, true );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingTest() throws Exception {
 String path = getClass().getResource( "txt-sample.txt" ).getPath();
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), path );
 assertEquals( "US-ASCII", encoding );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingWithoutFailIfNoFileTest() throws Exception {
 String path = getClass().getResource( "txt-sample.txt" ).getPath();
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), path, false );
 assertEquals( "US-ASCII", encoding );
}
origin: pentaho/pentaho-kettle

@Test( expected = KettleValueException.class )
public void getFileEncodingMissingFileTest() throws KettleValueException {
 String nonExistingPath = "nonExistingPath";
 ValueDataUtil.getFileEncoding( new ValueMetaString(), nonExistingPath );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingNullPathNoFailTest() throws Exception {
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), null, false );
 assertNull( encoding );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingNoFailIfNoFileTest() throws Exception {
 String nonExistingPath = "nonExistingPath";
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), nonExistingPath, false );
 assertNull( encoding );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingNullPathFailTest() throws KettleFileNotFoundException, KettleValueException {
 String encoding = ValueDataUtil.getFileEncoding( new ValueMetaString(), null, true );
 assertNull( encoding );
}
origin: pentaho/pentaho-kettle

@Test
public void getFileEncodingNullPathTest() throws Exception {
 assertNull( ValueDataUtil.getFileEncoding( new ValueMetaString(), null ) );
}
origin: pentaho/pentaho-kettle

 break;
case CalculatorMetaFunction.CALC_GET_FILE_ENCODING: // Get file encoding from a file A
 calcData[index] = ValueDataUtil.getFileEncoding( metaA, dataA, meta.isFailIfNoFile() );
 resultType = CalculatorMetaFunction.calcDefaultResultType[calcType];
 break;
org.pentaho.di.core.rowValueDataUtilgetFileEncoding

Javadoc

Get file encoding.

Popular methods of ValueDataUtil

  • checksumAdler32
  • checksumCRC32
  • createChecksum
  • isXMLFileWellFormed
    Checks an xml file is well formed.
  • loadFileContentInBinary
  • plus
  • round
    Rounding with decimal places with a given rounding method
  • DateDiff
    Returns the number of days that have elapsed between dataA and dataB.
  • DateWorkingDiff
  • combination1
    A + B * C
  • combination2
    SQRT( A*A + B*B )
  • divide
  • combination2,
  • divide,
  • divideBigDecimals,
  • getJaroWinkler_Similitude,
  • getJaro_Similitude,
  • isSpace,
  • minus,
  • multiply,
  • multiplyBigDecimals

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now