|
Hi all, I need a script I can run locally on a computer to pull a folder from google drive and save it to a specific location.
And I was wondering if anyone could point me in the right direction or if anyone has anything I can reverse engineer to get my head around it?
Thanks.
|
|
|
|
|
Does this have anything to do with Java?
By the way, this site does not provide code to order.
|
|
|
|
|
Because Java is the language I'd like to build it in. And I'm aware the site isn't going to provide code to order, hence I was asking for direction. Not a solution...
|
|
|
|
|
|
Following in google seems to produce many results
java google drive api example
|
|
|
|
|
How can i make a digital alarm clock in javafx i am new in java and we have a project to do any help would be appreciated
|
|
|
|
|
|
I'm working in a web application using spring mvc 4 (version: 4.0.9.RELEASE) and spring security 3 (version: 3.2.5.RELEASE), my problem is that i can't restrict access to specific view (.html page) inside a folder.
I have three (3) modules in my web application: Roles, Permissions, Users. Each module have CRUD operations (insert, create, read, delete). I have created twelve (12) permissions in forms of roles in my spring secuirty configuration, each permission would be in charge of a CRUD operation, i would have a permission to create users another one to delete roles and so on until i have 12 permissions.
I said that i created those permissions as roles is because in my web application i have a create role requeriment and in this requeriment i can create a new role and this new role can have permissions mixed from modules, i mean i can create a role that have a create user permission and also delete a role permission.
Beacuse of this i can´t have harcoded the access to the modules using roles in my spring security configuration , but since is not a requeriment to create new permissions i used the permissions to be hardcoded instead of the roles in my spring security configuration.
Even if i use this Spring EL expressions "hasRole", in my bussines logic the string i pass to that expression is a name of a permission that i have stored in my data base.
I have 3 folders: Roles, Permissions, Users; and each folder contains a page for each crud operation like this:
---Roles
--addRole.html
--deleteRole.html
--readRole.html
--insertRole.html
---Users (same level as Role)
--.... the same as role but with users
---Permissions (same level as Role)
--...the same as role but with permission
My problem is that i want to create my spring secuirty configuration to restrict access per page and not per folder, i would like to need to have a specific permission to access a page like this
.antMatchers("/addRole/").access("hasRole('PERM_ADD_ROLE')")
.antMatchers("/deleteRole/").access("hasRole('PERM_DELETE_ROLE')")
.antMatchers("/readRole/").access("hasRole('PERM_READ_ROLE')")
.antMatchers("/insertRole/").access("hasRole('PERM_INSERT_ROLE')"
.antMatchers("/addUser/").access("hasRole('PERM_ADD_USER')")
.antMatchers("/deleteUser/").access("hasRole('PERM_DELETE_USER')")
But when i do this if i log-in with a user that have PERM_ADD_ROLE this user have access to all the ROLE pages ( deleteRole, readRole an insertROle) and this shouldn't happen, the user should have only access to the addRole page since his permission is "PERM_ADD_ROLE", but since the other pages i mention are in the same folder Roles i believe thats why he access them but this shouldn't happen.
My project in spring mvc is configured using java config and no XMLs, i have my application configured with classes and not XML
Here is my spring security class configuration.
@Configuration
@EnableWebMvcSecurity
public class SecurityConfign extends WebSecurityConfigurerAdapter {
@Autowired
private AutProvider aut;
@Override
protected void configure( HttpSecurity http ) throws Exception
{
http
.authenticationProvider(aut)
.authorizeRequests()
.antMatchers("/resources/").permitAll()
.antMatchers("/css/").permitAll()
.antMatchers("/js/").permitAll()
.antMatchers("/img/").permitAll()
.antMatchers("/sound/").permitAll()
.antMatchers("/fonts/").permitAll()
.antMatchers("/ajax/").permitAll()
.antMatchers("/php/").permitAll()
.antMatchers("/xml/").permitAll()
.antMatchers("/addRole/").access("hasRole('PERM_ADD_ROLE')")
.antMatchers("/deleteRole/").access("hasRole('PERM_DELETE_ROLE')")
.antMatchers("/readRole/").access("hasRole('PERM_READ_ROLE')")
.antMatchers("/insertRole/").access("hasRole('PERM_INSERT_ROLE')"<br />
.antMatchers("/addUser/").access("hasRole('PERM_ADD_USER')")
.antMatchers("/deleteUser/**").access("hasRole('PERM_DELETE_USER')")
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login/login")
.permitAll()
.and()
.logout()<br />
.permitAll()
.and()
.csrf().disable();
}
}
And here is my AuthenticationProvider class
@Component
public class AutProvider implements AuthenticationProvider {
@Override
public Authentication authenticate(Authentication authentication)
throws AuthenticationException {
String name = null;
String password = null;
Authentication auth = null;
try {
name = authentication.getName();
password = authentication.getCredentials().toString();
if (name.equals("admin@admin.com") && password.equals("password")) {
List<GrantedAuthority> grantedAuths = new ArrayList<>();
grantedAuths.add(new SimpleGrantedAuthority("PERM_ADD_ROLE"));
grantedAuths.add(new SimpleGrantedAuthority("PERM_ADD_USER"));
auth = new UsernamePasswordAuthenticationToken(name, password, grantedAuths);
}
} catch (AuthenticationException e) {
e.printStackTrace();
throw e;
}
return auth;
}
@Override
public boolean supports(Class<?> authentication) {
return authentication.equals(UsernamePasswordAuthenticationToken.class);
}
}
and here is some of my controllers as and example the Role COntroller
@Controller
@RequestMapping("/roles/")
public class RoleController {
@RequestMapping(value = "readRole", method = RequestMethod.GET)
public String readArole(Model model) {
return "/roles/readRole";
}
}
In resume if i give a specifc permission to a user like PERM_ADD_ROLE with this permission the user have access to all the pages in the Roles folder and this shouldn't happen.
|
|
|
|
|
|
Some one help me with the second bit of this question
Java can work well with files. It is a matter of importing the relevant files in the java.io class and have
the files executed. In executing files, some times exceptions happen. For example, the file in code may
not be there on the disk. That makes the code unable to run properly. Therefore the exception has to be
either caught or thrown.
In this assignment, you are going to read data from a file and then write it in another file. The file
given 'marks.txt' should be written with the same data but in another file 'marks.xls'. Since the marks
are only coursework and Exam, in the marks.xls, indicate the final mark where final mark = cw*0.40 +
ex*0.60. Also indicate if the candidate Excelled (over 70%), passed (50% - 69) and Fail (Less than
50%)
|
|
|
|
|
If this is question set by your professor, then I strongly suggest you find another course where the teacher actually understands the subject.
In the meantime, exactly what help do you need?
|
|
|
|
|
just help me with the reading and writing part of the program that will read data from the created text file that contains the names and marks of students and then writes the read data to an excell files while commenting on their marks as stated in the questions
|
|
|
|
|
You keep saying "help me" but you fail to say what help you need.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You can use the Scanner class[^] to read the input file, and follow the link that jschell gave you for writing.
|
|
|
|
|
Thanks Richard MacCutchan, I read through and it was helpful
|
|
|
|
|
|
i want to read from a text file forexample me.txt and copy the text that is in me.txt and write it to a new excel sheet.
|
|
|
|
|
Hi,
How can i Make a function directory count that finds how many directories and sub directories are in a folder, and Make a directory Size recursive function that finds the size of each folder and sub folders.
The following can be an example of the result from your program.
Example result
Dir:c:\test\f1
File:t0.txt size 20 bytes
Folder: f1 size 20 bytes
|
|
|
|
|
|
java code for extracting result from command prompt to applet
|
|
|
|
|
|
what is the code for collecting the information from the ms access database and display in the applets
|
|
|
|
|
|
Am new to java tables in need of a code that can create the following interface of a message display board
|
|
|
|
|
Member 10683102 wrote: the following interface There's nothing following your first sentence.
Apart from that you usually write an interface manually.
|
|
|
|