Tabnine Logo
Integer.toOctalString
Code IndexAdd Tabnine to your IDE (free)

How to use
toOctalString
method
in
java.lang.Integer

Best Java code snippets using java.lang.Integer.toOctalString (Showing top 20 results out of 1,233)

origin: hierynomus/sshj

@Override
public String toString() {
  return "[mask=" + Integer.toOctalString(mask) + "]";
}
origin: hierynomus/sshj

@Override
public void setPermissions(int perms)
    throws IOException {
  log.info("permissions = {}", Integer.toOctalString(perms));
}
origin: loklak/loklak_server

public static String encodeOctal(final byte[] in) {
  if (in == null) return "";
  final StringBuilder result = new StringBuilder(in.length * 8 / 3);
  for (final byte element : in) {
    if ((0Xff & element) < 8) result.append('0');
    result.append(Integer.toOctalString(0Xff & element));
  }
  return result.toString();
}
origin: hierynomus/sshj

private String getPermString(LocalSourceFile f)
    throws IOException {
  return Integer.toOctalString(f.getPermissions() & 07777);
}
origin: plantuml/plantuml

if (b.length == 1) {
  final int code = b[0] & 0xFF;
  sb.append("\\" + Integer.toOctalString(code));
} else {
  sb.append('?');
origin: apache/geode

@Override
public String getValueAsString() {
 if (isString()) {
  return (String) this.value;
 } else if (isInetAddress()) {
  return InetAddressUtil.toString(this.value);
 } else if (isFile()) {
  return this.value.toString();
 } else if (isOctal()) {
  String strVal = Integer.toOctalString(((Integer) this.value).intValue());
  if (!strVal.startsWith("0")) {
   strVal = "0" + strVal;
  }
  return strVal;
 } else if (isArray()) {
  List list = Arrays.asList((Object[]) this.value);
  return list.toString();
 } else {
  return this.value.toString();
 }
}
origin: redisson/redisson

  break;
case 'o':
  r = Integer.toOctalString(x);
  break;
case 'x':
origin: redisson/redisson

  break;
case 'o':
  r = Integer.toOctalString(value & unsignedMask);
  break;
case 'x':
origin: JetBrains/ideavim

int num = (int)Long.parseLong(text, 8);
num += count;
number = Integer.toOctalString(num);
number = "0" + StringHelper.rightJustify(number, text.length() - 1, '0');
origin: apache/ignite

/**
 * Convert POSIX attributes to property map.
 *
 * @param attrs Attributes view.
 * @return IGFS properties map.
 */
public static Map<String, String> posixAttributesToMap(PosixFileAttributes attrs) {
  if (attrs == null)
    return null;
  Map<String, String> props = U.newHashMap(3);
  props.put(IgfsUtils.PROP_USER_NAME, attrs.owner().getName());
  props.put(IgfsUtils.PROP_GROUP_NAME, attrs.group().getName());
  int perm = 0;
  for(PosixFilePermission p : attrs.permissions())
    perm |= (1 << 8 - p.ordinal());
  props.put(IgfsUtils.PROP_PERMISSION, '0' + Integer.toOctalString(perm));
  return props;
}
origin: Alluxio/alluxio

/**
 * Changes the permissions of directory or file with the path specified in args.
 *
 * @param path The {@link AlluxioURI} path as the input of the command
 * @param modeStr The new permission to be updated to the file or directory
 * @param recursive Whether change the permission recursively
 */
private void chmod(AlluxioURI path, String modeStr, boolean recursive) throws
  AlluxioException, IOException {
 Mode mode = ModeParser.parse(modeStr);
 SetAttributePOptions options =
   SetAttributePOptions.newBuilder().setMode(mode.toProto()).setRecursive(recursive).build();
 mFileSystem.setAttribute(path, options);
 System.out
   .println("Changed permission of " + path + " to " + Integer.toOctalString(mode.toShort()));
}
origin: apache/hive

   Integer.toOctalString(
     jobInfo.getOutputSchema().getFields().size()));
} else if (ofclass == OrcOutputFormat.class) {
origin: apache/ignite

/** {@inheritDoc} */
@Override public String permissions(String path) throws IOException {
  Path p = path(path);
  PosixFileAttributeView attrView = Files.getFileAttributeView(p, PosixFileAttributeView.class);
  if (attrView == null)
    throw new UnsupportedOperationException("Posix file attributes not available");
  int perm = 0;
  for(PosixFilePermission pfp : attrView.readAttributes().permissions())
    perm |= (1 << 8 - pfp.ordinal());
  return '0' + Integer.toOctalString(perm);
}
origin: apache/nifi

int perms = numberPermissions(permissions);
if (perms >= 0) {
  if (!client.sendSiteCommand("chmod " + Integer.toOctalString(perms) + " " + tempFilename)) {
    logger.warn("Could not set permission on {} to {}", new Object[] {flowFile, permissions});
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * {@inheritDoc}
 * <p>
 * Format this mode as an octal string (for debugging only).
 */
@Override
public String toString() {
  return Integer.toOctalString(modeBits);
}
origin: stackoverflow.com

public class OctalObserver extends Observer{
 public OctalObserver(Subject subject){
  this.subject = subject;
 this.subject.attach(this);
}
@Override
public void update() {
 System.out.println( "Octal String: " 
 + Integer.toOctalString( subject.getState() ) ); 
}
origin: yacy/yacy_grid_mcp

public static String encodeOctal(final byte[] in) {
  if (in == null) return "";
  final StringBuilder result = new StringBuilder(in.length * 8 / 3);
  for (final byte element : in) {
    if ((0Xff & element) < 8) result.append('0');
    result.append(Integer.toOctalString(0Xff & element));
  }
  return result.toString();
}
origin: geotools/geotools

void encodeByteArrayAsEscape(byte[] input, StringBuffer sql) {
  // escape the into bytea representation
  StringBuffer sb = new StringBuffer();
  for (int i = 0; i < input.length; i++) {
    byte b = input[i];
    if (b == 0) {
      sb.append("\\\\000");
    } else if (b == 39) {
      sb.append("\\'");
    } else if (b == 92) {
      sb.append("\\\\134'");
    } else if (b < 31 || b >= 127) {
      sb.append("\\\\");
      String octal = Integer.toOctalString(b);
      if (octal.length() == 1) {
        sb.append("00");
      } else if (octal.length() == 2) {
        sb.append("0");
      }
      sb.append(octal);
    } else {
      sb.append((char) b);
    }
  }
  super.encodeValue(sb.toString(), String.class, sql);
}
origin: pentaho/mondrian

@FunctionName("Oct")
@Signature("Oct(number)")
@Description(
  "Returns a Variant (String) representing the octal value of a number.")
public static String oct(Object number) {
  if (number instanceof Number) {
    return Integer.toOctalString(((Number) number).intValue());
  } else {
    throw new InvalidArgumentException(
      "Invalid parameter. "
      + "number parameter " + number
      + " of Oct function must be " + "of type number");
  }
}
origin: org.apache.hadoop/hadoop-hdfs

public static SnapshottableDirectoryStatus.Bean toBean(INodeDirectory d) {
 return new SnapshottableDirectoryStatus.Bean(
   d.getFullPathName(),
   d.getDirectorySnapshottableFeature().getNumSnapshots(),
   d.getDirectorySnapshottableFeature().getSnapshotQuota(),
   d.getModificationTime(),
   Short.valueOf(Integer.toOctalString(
     d.getFsPermissionShort())),
   d.getUserName(),
   d.getGroupName());
}
java.langIntegertoOctalString

Javadoc

Converts the specified integer into its octal string representation. The returned string is a concatenation of characters from '0' to '7'.

Popular methods of Integer

  • parseInt
    Parses the specified string as a signed integer value using the specified radix. The ASCII character
  • toString
    Converts the specified signed integer into a string representation based on the specified radix. The
  • valueOf
    Parses the specified string as a signed integer value using the specified radix.
  • intValue
    Gets the primitive value of this int.
  • <init>
    Constructs a new Integer from the specified string.
  • toHexString
    Returns a string representation of the integer argument as an unsigned integer in base 16.The unsign
  • equals
    Compares this instance with the specified object and indicates if they are equal. In order to be equ
  • compareTo
    Compares this Integer object to another object. If the object is an Integer, this function behaves l
  • hashCode
  • compare
    Compares two int values.
  • longValue
    Returns the value of this Integer as along.
  • decode
    Parses the specified string and returns a Integer instance if the string can be decoded into an inte
  • longValue,
  • decode,
  • numberOfLeadingZeros,
  • getInteger,
  • doubleValue,
  • toBinaryString,
  • byteValue,
  • bitCount,
  • shortValue,
  • highestOneBit

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now