Tabnine Logo
Platform$OS.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
jnr.ffi.Platform$OS

Best Java code snippets using jnr.ffi.Platform$OS.equals (Showing top 8 results out of 315)

origin: com.github.jnr/jnr-netdb

private static final File locateProtocolsFile() {
  if (Platform.getNativePlatform().getOS().equals(WINDOWS)) {
    String systemRoot;
    try {
      // FIXME: %SystemRoot% is typically *not* present in Java env,
      // so we need a better way to obtain the Windows location.
      // One possible solution: Win32API's SHGetFolderPath() with
      // parameter CSIDL_SYSTEM or CSIDL_WINDOWS.
      systemRoot = System.getProperty("SystemRoot", "C:\\windows");
    } catch (SecurityException se) {
      // whoops, try the most logical one
      systemRoot = "C:\\windows";
    }
    return new File(systemRoot + "\\system32\\drivers\\etc\\protocol");
  } else {
    return new File("/etc/protocols");
  }
}
origin: com.github.jnr/jnr-posix

public FromNativeConverter getFromNativeConverter(Class klazz) {
  if (Passwd.class.isAssignableFrom(klazz)) {
    if (Platform.IS_MAC) {
      return MacOSPOSIX.PASSWD;
    } else if (Platform.IS_LINUX) {
      return LinuxPOSIX.PASSWD;
    } else if (Platform.IS_SOLARIS) {
      return SolarisPOSIX.PASSWD;
    } else if (Platform.IS_FREEBSD) {
      return FreeBSDPOSIX.PASSWD;
    } else if (Platform.IS_OPENBSD) {
      return OpenBSDPOSIX.PASSWD;
    } else if (Platform.IS_WINDOWS) {
      return WindowsPOSIX.PASSWD;
    } else if (jnr.ffi.Platform.getNativePlatform().getOS().equals(jnr.ffi.Platform.OS.AIX)) {
      return AixPOSIX.PASSWD;
    }
    return null;
  } else if (Group.class.isAssignableFrom(klazz)) {
    return BaseNativePOSIX.GROUP;
  } else if (HANDLE.class.isAssignableFrom(klazz)) {
    return HANDLE.Converter;
  }
  
  return null;
}

origin: com.facebook.presto.cassandra/cassandra-driver

public FromNativeConverter getFromNativeConverter(Class klazz) {
  if (Passwd.class.isAssignableFrom(klazz)) {
    if (Platform.IS_MAC) {
      return MacOSPOSIX.PASSWD;
    } else if (Platform.IS_LINUX) {
      return LinuxPOSIX.PASSWD;
    } else if (Platform.IS_SOLARIS) {
      return SolarisPOSIX.PASSWD;
    } else if (Platform.IS_FREEBSD) {
      return FreeBSDPOSIX.PASSWD;
    } else if (Platform.IS_OPENBSD) {
      return OpenBSDPOSIX.PASSWD;
    } else if (Platform.IS_WINDOWS) {
      return WindowsPOSIX.PASSWD;
    } else if (jnr.ffi.Platform.getNativePlatform().getOS().equals(jnr.ffi.Platform.OS.AIX)) {
      return AixPOSIX.PASSWD;
    }
    return null;
  } else if (Group.class.isAssignableFrom(klazz)) {
    return BaseNativePOSIX.GROUP;
  } else if (HANDLE.class.isAssignableFrom(klazz)) {
    return HANDLE.Converter;
  }
  
  return null;
}

origin: com.github.jnr/jnr-netdb

if (!(os.equals(DARWIN) || (os.equals(WINDOWS) && Platform.getNativePlatform().getCPU() == Platform.CPU.I386)
    || os.equals(LINUX) || os.equals(SOLARIS)
    || os.equals(FREEBSD) || os.equals(NETBSD))) {
  return null;
if (os.equals(WINDOWS)) {
  Map<LibraryOption, Object> options = new HashMap<LibraryOption, Object>();
  options.put(LibraryOption.CallingConvention, CallingConvention.STDCALL);
  String[] libnames = os.equals(SOLARIS)
    ? new String[] { "socket", "nsl", "c" }
    : new String[] { "c" };
  if (os.equals(LINUX)) {
    lib = Library.loadLibrary(LinuxLibServices.class, libnames);
  } else {
NativeServicesDB services = os.equals(LINUX)
    ? new LinuxServicesDB(lib)
    : new DefaultNativeServicesDB(lib);
origin: com.github.jnr/jnr-netdb

if (!(os.equals(DARWIN) || (os.equals(WINDOWS) && Platform.getNativePlatform().getCPU() == Platform.CPU.I386)
    || os.equals(LINUX) || os.equals(SOLARIS)
    || os.equals(FREEBSD) || os.equals(NETBSD))) {
  return null;
if (os.equals(WINDOWS)) {
  Map<LibraryOption, Object> options = new HashMap<LibraryOption, Object>();
  options.put(LibraryOption.CallingConvention, CallingConvention.STDCALL);
  lib = Library.loadLibrary(LibProto.class, options, "Ws2_32");
} else {
  String[] libnames = os.equals(SOLARIS)
      ? new String[]{"socket", "nsl", "c"}
      : new String[]{"c"};
  lib = os.equals(LINUX)
    ? Library.loadLibrary(LinuxLibProto.class, libnames)
    : Library.loadLibrary(LibProto.class, libnames);
NativeProtocolsDB protocolsDB = os.equals(LINUX)
    ? new LinuxNativeProtocolsDB((LinuxLibProto) lib)
    : new DefaultNativeProtocolsDB(lib);
origin: com.cloudbees.util/jnr-unixsocket-nodep

public FromNativeConverter getFromNativeConverter(Class klazz) {
  if (Passwd.class.isAssignableFrom(klazz)) {
    if (Platform.IS_MAC) {
      return MacOSPOSIX.PASSWD;
    } else if (Platform.IS_LINUX) {
      return LinuxPOSIX.PASSWD;
    } else if (Platform.IS_SOLARIS) {
      return SolarisPOSIX.PASSWD;
    } else if (Platform.IS_FREEBSD) {
      return FreeBSDPOSIX.PASSWD;
    } else if (Platform.IS_OPENBSD) {
      return OpenBSDPOSIX.PASSWD;
    } else if (Platform.IS_WINDOWS) {
      return WindowsPOSIX.PASSWD;
    } else if (jnr.ffi.Platform.getNativePlatform().getOS().equals(jnr.ffi.Platform.OS.AIX)) {
      return AixPOSIX.PASSWD;
    }
    return null;
  } else if (Group.class.isAssignableFrom(klazz)) {
    return BaseNativePOSIX.GROUP;
  } else if (HANDLE.class.isAssignableFrom(klazz)) {
    return HANDLE.Converter;
  }
  
  return null;
}

origin: io.prestosql.cassandra/cassandra-driver

public FromNativeConverter getFromNativeConverter(Class klazz) {
  if (Passwd.class.isAssignableFrom(klazz)) {
    if (Platform.IS_MAC) {
      return MacOSPOSIX.PASSWD;
    } else if (Platform.IS_LINUX) {
      return LinuxPOSIX.PASSWD;
    } else if (Platform.IS_SOLARIS) {
      return SolarisPOSIX.PASSWD;
    } else if (Platform.IS_FREEBSD) {
      return FreeBSDPOSIX.PASSWD;
    } else if (Platform.IS_OPENBSD) {
      return OpenBSDPOSIX.PASSWD;
    } else if (Platform.IS_WINDOWS) {
      return WindowsPOSIX.PASSWD;
    } else if (jnr.ffi.Platform.getNativePlatform().getOS().equals(jnr.ffi.Platform.OS.AIX)) {
      return AixPOSIX.PASSWD;
    }
    return null;
  } else if (Group.class.isAssignableFrom(klazz)) {
    return BaseNativePOSIX.GROUP;
  } else if (HANDLE.class.isAssignableFrom(klazz)) {
    return HANDLE.Converter;
  }
  
  return null;
}

origin: embulk/embulk-input-jdbc

  private static String convert(String sql)
  {
    if (Platform.getNativePlatform().getOS().equals(OS.WINDOWS)) {
      // '"' should be '\"' and '\' should be '\\' in Windows
      return sql.replace("\\\\", "\\").replace("\\", "\\\\").replace("\"", "\\\"");
    }
    return sql;
  }
}
jnr.ffiPlatform$OSequals

Popular methods of Platform$OS

  • name
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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