comparison src/luan/modules/IoLuan.java @ 1120:e8fc6712b468

luan Rpc uses luan.lib.rpc
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Aug 2017 23:50:52 -0600
parents 590437ce0be3
children 4cf541886663
comparison
equal deleted inserted replaced
1119:87c674f3f6b7 1120:e8fc6712b468
862 public static LuanTable bash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { 862 public static LuanTable bash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException {
863 return new LuanBash(luan,cmd,options).table(); 863 return new LuanBash(luan,cmd,options).table();
864 } 864 }
865 865
866 866
867
868 public static class LuanInput extends LuanIn {
869 private final InputStream in;
870
871 public LuanInput(InputStream in) {
872 this.in = in;
873 }
874
875 @Override public InputStream inputStream() {
876 return in;
877 }
878
879 @Override public String to_string() {
880 return "<input_stream>";
881 }
882
883 @Override public String to_uri_string() {
884 throw new UnsupportedOperationException();
885 }
886
887 @Override public boolean exists() {
888 return true;
889 }
890 };
891
892
867 public static String ip(String domain) { 893 public static String ip(String domain) {
868 try { 894 try {
869 return InetAddress.getByName(domain).getHostAddress(); 895 return InetAddress.getByName(domain).getHostAddress();
870 } catch(UnknownHostException e) { 896 } catch(UnknownHostException e) {
871 return null; 897 return null;