id
stringlengths
7
14
text
stringlengths
1
106k
3328338_2
public String performPreauth(String failmode) throws Exception { if (failmode.equals("secure")) { return "auth"; } else if (!failmode.equals("safe")) { throw new IllegalArgumentException("Failmode must be one of either safe or secure."); } // Check if Duo authentication is even necessary...
3328338_3
public String performPreauth(String failmode) throws Exception { if (failmode.equals("secure")) { return "auth"; } else if (!failmode.equals("safe")) { throw new IllegalArgumentException("Failmode must be one of either safe or secure."); } // Check if Duo authentication is even necessary...
3328338_4
public String signRequest() { return DuoWeb.signRequest(ikey, skey, akey, username); }
3328338_5
public boolean verifyResponseEqualsUsername(String duoResponse) { try { String duoVerifiedResponse = DuoWeb.verifyResponse(ikey, skey, akey, duoResponse); boolean usernameMatches = duoVerifiedResponse.equals(username); if (usernameMatches) { log.info(username + " successfully Duo...
3328338_6
public boolean verifyResponseEqualsUsername(String duoResponse) { try { String duoVerifiedResponse = DuoWeb.verifyResponse(ikey, skey, akey, duoResponse); boolean usernameMatches = duoVerifiedResponse.equals(username); if (usernameMatches) { log.info(username + " successfully Duo...
3332790_0
public JSONRequest setData(String data) { if (!dataMap.isEmpty()) { throw new IllegalStateException("You cannot use setData in combination with addField"); } if (data == null) { throw new IllegalArgumentException("data cannot be null"); } contents.writeBytes(Unpooled.wrappedBuffer(da...
3332790_1
public JSONRequest setData(String data) { if (!dataMap.isEmpty()) { throw new IllegalStateException("You cannot use setData in combination with addField"); } if (data == null) { throw new IllegalArgumentException("data cannot be null"); } contents.writeBytes(Unpooled.wrappedBuffer(da...
3332790_2
public ByteBuf serialize(Object msg) { ByteBuf buffer = Unpooled.buffer(); validateAndWriteType(buffer, msg); buffer.readerIndex(0); return buffer; }
3332790_3
public ByteBuf serialize(Object msg) { ByteBuf buffer = Unpooled.buffer(); validateAndWriteType(buffer, msg); buffer.readerIndex(0); return buffer; }
3332790_4
public void writeByte(ByteBuf buffer, byte b) { buffer.writeByte(BYTE); buffer.writeByte(b); }
3332790_5
public void writeNull(ByteBuf buffer) { buffer.writeByte(NULL); }
3332790_6
public void writeShort(ByteBuf buffer, short s) { buffer.writeByte(SHORT); buffer.writeShort(s); }
3332790_7
public void writeInt(ByteBuf buffer, int i) { buffer.writeByte(INT); buffer.writeInt(i); }
3332790_8
public void writeLong(ByteBuf buffer, long l) { buffer.writeByte(LONG); buffer.writeLong(l); }
3332790_9
public void writeFloat(ByteBuf buffer, float f) { buffer.writeByte(FLOAT); buffer.writeFloat(f); }
3333998_0
public Long getTimestamp() { return timestamp; }
3333998_1
public static String toPairString(CurrencyPair currencyPair) { return currencyPair.base.getCurrencyCode().toLowerCase() + currencyPair.counter.getCurrencyCode().toLowerCase(); }
3333998_2
public static Date toDate(String dateString) { try { return dateParserNoMillis().parse(dateString); } catch (ParseException e) { OffsetDateTime offsetDateTime = OffsetDateTime.parse(dateString); return new Date(offsetDateTime.toInstant().toEpochMilli()); } }
3333998_3
protected static OrderBook adaptOrderBookIncremental( OrderBook prevOrderBook, CexioWebSocketOrderBookSubscribeResponse update) { CurrencyPair currencyPair = adaptCurrencyPair(update.pair); prevOrderBook = updateOrInsertQuantityForPrice( prevOrderBook, update.asks, OrderType....
3333998_4
public static String adaptCcyPairsToUrlFormat(Iterable<CurrencyPair> currencyPairs) { return StreamSupport.stream(currencyPairs.spliterator(), false) .map(YoBitAdapters::adaptCcyPairToUrlFormat) .collect(Collectors.joining("-")); }
3333998_5
public synchronized LimitOrder postOrder(String apiKey, Order original) { LOGGER.debug("User {} posting order: {}", apiKey, original); validate(original); Account account = accountFactory.get(apiKey); checkBalance(original, account); BookOrder takerOrder = BookOrder.fromOrder(original, apiKey); switch (take...
3333998_6
public synchronized LimitOrder postOrder(String apiKey, Order original) { LOGGER.debug("User {} posting order: {}", apiKey, original); validate(original); Account account = accountFactory.get(apiKey); checkBalance(original, account); BookOrder takerOrder = BookOrder.fromOrder(original, apiKey); switch (take...
3333998_7
public synchronized LimitOrder postOrder(String apiKey, Order original) { LOGGER.debug("User {} posting order: {}", apiKey, original); validate(original); Account account = accountFactory.get(apiKey); checkBalance(original, account); BookOrder takerOrder = BookOrder.fromOrder(original, apiKey); switch (take...
3333998_8
public synchronized LimitOrder postOrder(String apiKey, Order original) { LOGGER.debug("User {} posting order: {}", apiKey, original); validate(original); Account account = accountFactory.get(apiKey); checkBalance(original, account); BookOrder takerOrder = BookOrder.fromOrder(original, apiKey); switch (take...
3333998_9
public synchronized LimitOrder postOrder(String apiKey, Order original) { LOGGER.debug("User {} posting order: {}", apiKey, original); validate(original); Account account = accountFactory.get(apiKey); checkBalance(original, account); BookOrder takerOrder = BookOrder.fromOrder(original, apiKey); switch (take...
3337772_0
public StorageReportInfoSerializer() { super(StorageReportInfo.class, StorageReportBase.SCHEMA_NAME, StorageReportBase.SCHEMA_VERSION); }
3337772_1
public StorageReportListSerializer() { super(StorageReportList.class, StorageReportBase.SCHEMA_NAME, StorageReportBase.SCHEMA_VERSION); }
3337772_2
public StorageReportSerializer() { super(StorageReport.class, StorageReportBase.SCHEMA_NAME, StorageReportBase.SCHEMA_VERSION); }
3337772_3
@Override public boolean isValid(SpaceForm spaceForm, ConstraintValidatorContext context) { try { // Test validity by attempting to delete a file that does not exist ContentStore contentStore = contentStoreFactory.create(spaceForm.getCredentialsForm(), false); ...
3337772_4
@Override public boolean isConfigurationComplete() { SyncToolConfig c = this.syncToolConfig; if (c == null) { return false; } if (StringUtils.isBlank(c.getUsername()) || StringUtils.isBlank(c.getUsername()) || StringUtils.isBlank(c.getPassword()) || StringUtils.isBlank(c....
3337772_5
@Override public void persistDuracloudConfiguration(String username, String password, String host, String port, String spaceId) { this.syncToolConfi...
3337772_6
@Override public DirectoryConfigs retrieveDirectoryConfigs() { DirectoryConfigs c = new DirectoryConfigs(); List<File> dirs = this.syncToolConfig.getContentDirs(); for (File f : dirs) { c.add(new DirectoryConfig(f.getAbsolutePath())); } return c; }
3337772_7
@Override public DuracloudConfiguration retrieveDuracloudConfiguration() { SyncToolConfig s = this.syncToolConfig; return new DuracloudConfiguration(s.getUsername(), s.getPassword(), s.getHost(), s....
3337772_8
@Override public void purgeWorkDirectory() { try { FileUtils.cleanDirectory(SyncUIConfig.getWorkDir()); } catch (IOException e) { log.error("Unable to clean work directory due to: " + e.getMessage()); } }
3337772_9
@Override public ContentStoreManager create() throws ContentStoreException { DuracloudConfiguration dc = this.syncConfigurationManager.retrieveDuracloudConfiguration(); ContentStoreManager csm = new ContentStoreManagerImpl(dc.getHost(), String.valueOf(dc.getPo...
3352045_0
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_1
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_2
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_3
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_4
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_5
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_6
public static void validateString(String value, StringParameter param) throws PDUStringException { if (param.getType() == StringType.C_OCTEC_STRING) { if (param.isRangeMinAndMax()) { if (!isCOctetStringValid(value, param.getMax())) { throw new PDUStringException("C-Octet ...
3352045_7
public static short bytesToShort(byte[] bytes) { return bytesToShort(bytes, 0); }
3352045_8
public Sequence(int start) { value = start; }
3352045_9
public synchronized int nextValue() { int curValue = value++; if (curValue == Integer.MAX_VALUE) { value = 1; } return curValue; }
335218_10
private static void writeInternalHTML(ErrorDetail errorDetail, Writer writer) throws IOException { writer.write("<html>\n"); writer.write(" <body>\n"); writer.write(" <h1>Status " + errorDetail.getStatus() + " (" + errorDetail.getStatus().name() + ")</h1>\n"); writer.write(" <p>" + errorDetail.ge...
335218_11
private static void writeInternalCSV(ErrorDetail errorDetail, Writer writer) throws IOException { writer.write("URI;" + errorDetail.getRequest() + ";\n"); writer.write("Status;" + errorDetail.getStatus() + " (" + errorDetail.getStatus().getReasonPhrase() + ");\n"); writer.write("Message;" + errorDetail.getM...
335218_12
@Override protected boolean supports(Class<?> aClass) { return Datenpaket.class.equals(aClass); }
335218_13
public void readDatenpaket() throws IOException { readVorsatz(); while (true) { Satz satz = Datenpaket.importSatz(reader); notice(satz); if (satz.getSatzart() == 9999) { break; } } }
335218_14
public void readDatenpaket() throws IOException { readVorsatz(); while (true) { Satz satz = Datenpaket.importSatz(reader); notice(satz); if (satz.getSatzart() == 9999) { break; } } }
335218_15
@Override public void write(final Datenpaket datenpaket) throws IOException { String value = OBJECT_MAPPER.writeValueAsString(datenpaket); this.write(value); }
335218_16
@Override public void write(Satz satz) throws IOException { satz.export(this.getWriter()); this.getWriter().flush(); }
335218_17
@Override public void write(Satz satz) throws IOException { satz.export(this.getWriter()); this.getWriter().flush(); }
335218_18
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_19
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_20
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_21
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_22
public static void registerEnum(final Class<? extends Enum> enumClass, final int satzart) { registerEnum(enumClass, new SatzTyp(satzart)); }
335218_23
public static Datensatz getDatensatz(final int satzart) { return (Datensatz) getSatz(satzart); }
335218_24
public static Datensatz getDatensatz(final int satzart) { return (Datensatz) getSatz(satzart); }
335218_25
public static Datenpaket getAllSupportedSaetze() { Datenpaket all = new Datenpaket(); for (int i = 2; i < 9999; i++) { try { all.add((Datensatz) getSatz(i)); } catch (NotRegisteredException ex) { LOG.trace("Datensatz " + i + " is not a supported: ", ex); } } ...
335218_26
public static void registerEnum(final Class<? extends Enum> enumClass, final int satzart) { registerEnum(enumClass, new SatzTyp(satzart)); }
335218_27
public static Datensatz getDatensatz(final int satzart) { return (Datensatz) getSatz(satzart); }
335218_28
public static Datenpaket getAllSupportedSaetze() { Datenpaket all = new Datenpaket(); for (int i = 2; i < 9999; i++) { try { all.add((Datensatz) getSatz(i)); } catch (NotRegisteredException ex) { LOG.trace("Datensatz " + i + " is not a supported: ", ex); } } ...
335218_29
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_30
public static Satz getSatz(final int satzart) { return getSatz(new SatzTyp(satzart)); }
335218_31
public static Datensatz getDatensatz(final int satzart) { return (Datensatz) getSatz(satzart); }
335218_32
@Override public void write(final Datenpaket datenpaket) throws IOException { buildHead(datenpaket); this.writeHead(); this.writeBody(datenpaket); }
335218_33
public static String toString(final Datenpaket datenpaket) { StringWriter swriter = new StringWriter(); HtmlFormatter formatter = new HtmlFormatter(swriter); try { formatter.write(datenpaket); } catch (IOException shouldnothappen) { throw new ShitHappenedException("can't convert " + date...
335218_34
public static String toString(final Feld feld) { StringWriter swriter = new StringWriter(); XmlFormatter formatter = new XmlFormatter(swriter); try { formatter.write(feld); } catch (XMLStreamException shouldnothappen) { throw new ShitHappenedException("can't convert " + feld + " to Strin...
335218_35
public static String toString(final Feld feld) { StringWriter swriter = new StringWriter(); XmlFormatter formatter = new XmlFormatter(swriter); try { formatter.write(feld); } catch (XMLStreamException shouldnothappen) { throw new ShitHappenedException("can't convert " + feld + " to Strin...
335218_36
public static String toString(final Feld feld) { StringWriter swriter = new StringWriter(); XmlFormatter formatter = new XmlFormatter(swriter); try { formatter.write(feld); } catch (XMLStreamException shouldnothappen) { throw new ShitHappenedException("can't convert " + feld + " to Strin...
335218_37
public static String toString(final Feld feld) { StringWriter swriter = new StringWriter(); XmlFormatter formatter = new XmlFormatter(swriter); try { formatter.write(feld); } catch (XMLStreamException shouldnothappen) { throw new ShitHappenedException("can't convert " + feld + " to Strin...
335218_38
public XmlFormatter() { this(System.out); }
335218_39
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof SatzTyp)) { return false; } SatzTyp other = (SatzTyp) obj; return (this.satzart == other.satzart) && (this.sparte == other.sparte) && (this.wagnisart == other.wagnisart) && (this.kranke...
335218_40
@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append(new DecimalFormat("0000").format(this.satzart)); if (this.sparte >= 0) { buf.append("." + new DecimalFormat("000").format(this.sparte)); if (this.wagnisart >= 0) { buf.append("."); buf.append(this.wagnisart); if (th...
335218_41
@SuppressWarnings("javasecurity:S2083") private String readFile() throws IOException { File file = new File(url); return FileUtils.readFileToString(file, Config.DEFAULT_ENCODING); }
335218_42
@Override public int read() throws IOException { if (this.isBufferEmpty()) { this.fillBuffer(); } return this.buffer[pos++]; }
335218_43
@Override public int read() throws IOException { int ch = super.read(); if (ch == '\n') { this.lineNumber++; } return ch; }
335218_44
public String readLine() throws IOException { char[] buf = new char[257]; int len = 257; for (int i = 0; i < len; i++) { int ch = this.read(); if ((ch == -1) || (ch == '\n') || (ch == '\r') || (ch == 0)) { len = i; break; } buf[i] = (char) ch; } ...
335218_45
public ImportException(final String message) { super(message); }
335218_46
@Override public int read(final char[] cbuf, final int off, final int len) throws IOException { return reader.read(cbuf, off, len); }
335218_47
@Override public long skip(final long n) throws IOException { return this.reader.skip(n); }
335218_48
public static Connection getConnection() throws SQLException { return instance.getDbConnection(); }
335218_49
public static synchronized VUNummer getVUNummer() { if (vunummer == null) { vunummer = new VUNummer(System.getProperty(GDV_VU_NUMMER, DUMMY_VU_NUMMER)); } return vunummer; }
335218_50
public Vorsatz() { // TODO: super("0001", Feld0001.values()) aufrufen, sobald Ctor verfuegbar super("0001", 3); setUpTeildatensaetze(); setUpVersions(); }
335218_51
public void setAbsender(final String name) { this.absender.setInhalt(name); }
335218_52
public void setErstellungsZeitraum(final String startDatum, final String endDatum) { this.von.setInhalt(startDatum); this.bis.setInhalt(endDatum); }
335218_53
public void setAdressat(final String name) { this.adressat.setInhalt(name); }
335218_54
public void setVersion(Bezeichner bezeichner, String version) { this.getFeld(bezeichner).setInhalt(version); }
335218_55
private FeldXml getFeld(Map<String, FeldXml> felder, String id) { FeldXml feldXml = felder.get(id); if (feldXml == null) { LOG.info("Will try fallback for reference '{}'.", id); feldXml = MISSING_FELDER.get(id); } if (feldXml == null) { throw new IllegalArgumentException("referen...
335218_56
public FeldReferenz getFeldRefenz(final Bezeichner bezeichner) { for (FeldReferenz ref : this.feldReferenzen) { if (bezeichner.equals(ref.getBezeichner())) { return ref; } } throw new IllegalArgumentException(bezeichner + " not part of " + this); }
335218_57
public String getId() { return this.id; }
335218_58
public final Datentyp getDatentyp() { return this.datentyp; }
335218_59
public final int getNachkommastellen() { return this.nachkommastellen; }
335218_60
public Feld toFeld(final int byteAddress) { return this.toFeld(byteAddress, this.getBezeichner()); }
335218_61
public String getId() { return this.id; }
335218_62
public String getName() { return this.bezeichner.getName(); }
335218_63
public String getTechnischerName() { return this.bezeichner.getTechnischerName(); }
335218_64
public String getAuspraegung() { return this.auspraegung; }