Tabnine Logo
SVNEncodingUtil.isASCIIControlChar
Code IndexAdd Tabnine to your IDE (free)

How to use
isASCIIControlChar
method
in
org.tmatesoft.svn.core.internal.util.SVNEncodingUtil

Best Java code snippets using org.tmatesoft.svn.core.internal.util.SVNEncodingUtil.isASCIIControlChar (Showing top 17 results out of 315)

origin: com.svnkit/com.springsource.org.tigris.subversion.javahl

public static boolean isValid(String path) {
  if (path == null) {
    return false;
  }
  for(int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      return false;
    }
  }
  return true;
}
origin: org.tmatesoft.svnkit/svnkit-javahl16

public static boolean isValid(String path) {
  if (path == null) {
    return false;
  }
  for(int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      return false;
    }
  }
  return true;
}
origin: org.codehaus.jtstand/jtstand-svnkit

public static boolean isValid(String path) {
  if (path == null) {
    return false;
  }
  for(int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      return false;
    }
  }
  return true;
}
origin: org.tmatesoft.svnkit/svnkit

protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException {
  if (str != null && str.length() > 0) {
    for (int i = 0; i < emptyFields; i++) {
      writer.write('\n');
    }
    for (int i = 0; i < str.length(); i++) {
      char ch = str.charAt(i);
      if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') {
        writer.write("\\x");
        writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch));
      } else {
        writer.write(ch);
      }
    }
    writer.write('\n');
    return true;
  }
  return false;
}
origin: org.jvnet.hudson.svnkit/svnkit

public static String fuzzyEscape(String str) {
  byte[] bytes = str.getBytes(); // native encoding
  StringBuffer result = createStringBuffer(str, 0);
  for (int i = 0; i < bytes.length; i++) {
    if (!isASCIIControlChar((char) bytes[i]) || bytes[i] == '\r' 
      || bytes[i] == '\n' || bytes[i] == '\t') {
      result.append((char) bytes[i]);
    } else {
      result.append("?\\");
      int code = bytes[i] & 0xFF;
      if (code < 100) {
        result.append('0');
      }
      result.append(code);
    }
  }
  return result.toString();
}
origin: org.codehaus.jtstand/jtstand-svnkit

public static String fuzzyEscape(String str) {
  byte[] bytes = str.getBytes(); // native encoding
  StringBuffer result = createStringBuffer(str, 0);
  for (int i = 0; i < bytes.length; i++) {
    if (!isASCIIControlChar((char) bytes[i]) || bytes[i] == '\r' 
      || bytes[i] == '\n' || bytes[i] == '\t') {
      result.append((char) bytes[i]);
    } else {
      result.append("?\\");
      int code = bytes[i] & 0xFF;
      if (code < 100) {
        result.append('0');
      }
      result.append(code);
    }
  }
  return result.toString();
}
origin: org.codehaus.jtstand/jtstand-svnkit

protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException {
  if (str != null && str.length() > 0) {
    for (int i = 0; i < emptyFields; i++) {
      writer.write('\n');
    }
    for (int i = 0; i < str.length(); i++) {
      char ch = str.charAt(i);
      if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') {
        writer.write("\\x");
        writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch));
      } else {
        writer.write(ch);
      }
    }
    writer.write('\n');
    return true;
  }
  return false;
}

origin: org.tmatesoft.svnkit/svnkit

public static String fuzzyEscape(String str) {
  char[] chars = str.toCharArray();
  StringBuffer result = createStringBuffer(str, 0);
  for (int i = 0; i < chars.length; i++) {
    if (!isASCIIControlChar(chars[i]) || chars[i] == '\r'
        || chars[i] == '\n' || chars[i] == '\t') {
      result.append(chars[i]);
    } else {
      result.append("?\\");
      int code = chars[i] & 0xFF;
      if (code < 100) {
        result.append('0');
      }
      result.append(code);
    }
  }
  return result.toString();
}
origin: org.jvnet.hudson.svnkit/svnkit

protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException {
  if (str != null && str.length() > 0) {
    for (int i = 0; i < emptyFields; i++) {
      writer.write('\n');
    }
    for (int i = 0; i < str.length(); i++) {
      char ch = str.charAt(i);
      if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') {
        writer.write("\\x");
        writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch));
      } else {
        writer.write(ch);
      }
    }
    writer.write('\n');
    return true;
  }
  return false;
}

origin: org.tmatesoft/svn

private boolean writeString(Writer writer, String str, int emptyFields) throws IOException {
  if (str != null && str.length() > 0) {
    for (int i = 0; i < emptyFields; i++) {
      writer.write('\n');
    }
    for (int i = 0; i < str.length(); i++) {
      char ch = str.charAt(i);
      if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') {
        writer.write("\\x");
        writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch));
      } else {
        writer.write(ch);
      }
    }
    writer.write('\n');
    return true;
  }
  return false;
}
 
origin: org.tmatesoft.svnkit/svnkit

  protected static void assertControlChars(String path) throws SVNException {
    if (path != null) {
      for (int i = 0; i < path.length(); i++) {
        char ch = path.charAt(i);
        String code = Integer.toHexString(ch);
        if (code.length() < 2) {
          code = "0" + code;
        }
        if (SVNEncodingUtil.isASCIIControlChar(ch)) {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character '0x" + code + "' in path '" + path + "'");
          SVNErrorManager.error(err, SVNLogType.DEFAULT);
        }
      }
    }
    return;
  }
}
origin: org.jvnet.hudson.svnkit/svnkit

  protected static void assertControlChars(String path) throws SVNException {
    if (path != null) {
      for (int i = 0; i < path.length(); i++) {
        char ch = path.charAt(i);
        String code = Integer.toHexString(ch);
        if (code.length() < 2) {
          code = "0" + code;
        }
        if (SVNEncodingUtil.isASCIIControlChar(ch)) {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character '0x" + code + "' in path '" + path + "'");
          SVNErrorManager.error(err, SVNLogType.DEFAULT);
        }
      }
    }
    return;
  }
}
origin: org.codehaus.jtstand/jtstand-svnkit

  protected static void assertControlChars(String path) throws SVNException {
    if (path != null) {
      for (int i = 0; i < path.length(); i++) {
        char ch = path.charAt(i);
        String code = Integer.toHexString(ch);
        if (code.length() < 2) {
          code = "0" + code;
        }
        if (SVNEncodingUtil.isASCIIControlChar(ch)) {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character '0x" + code + "' in path '" + path + "'");
          SVNErrorManager.error(err, SVNLogType.DEFAULT);
        }
      }
    }
    return;
  }
}
origin: org.tmatesoft/svn

public static void checkPathIsValid(String path) throws SVNException {
  for (int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[] {"''0x" + SVNFormatUtil.getHexNumberFromByte((byte)ch) + "''", path});
      SVNErrorManager.error(err);
    }
  }
}
 
origin: org.jvnet.hudson.svnkit/svnkit

public static void checkPathIsValid(String path) throws SVNException {
  for (int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path});
      SVNErrorManager.error(err, SVNLogType.DEFAULT);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-svnkit

public static void checkPathIsValid(String path) throws SVNException {
  for (int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path});
      SVNErrorManager.error(err, SVNLogType.DEFAULT);
    }
  }
}
origin: org.tmatesoft.svnkit/svnkit

public static void checkPathIsValid(String path) throws SVNException {
  for (int i = 0; i < path.length(); i++) {
    char ch = path.charAt(i);
    if (SVNEncodingUtil.isASCIIControlChar(ch)) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path});
      SVNErrorManager.error(err, SVNLogType.DEFAULT);
    }
  }
}
org.tmatesoft.svn.core.internal.utilSVNEncodingUtilisASCIIControlChar

Popular methods of SVNEncodingUtil

  • uriDecode
  • autoURIEncode
  • xmlEncodeCDATA
  • fuzzyEscape
  • isXMLSafe
  • assertURISafe
  • uriEncode
  • xmlEncodeAttr
  • createStringBuffer
  • hexValue
  • isHexDigit
  • xmlDecode
  • isHexDigit,
  • xmlDecode,
  • clearArray,
  • copyOf,
  • getBytes,
  • getChars

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ImageIO (javax.imageio)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Vim plugins
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